How to download Image from sharepoint in D365 by x++ and assign it to bitmap table field that it could be used in reports ?
This is quite a lot of requirements - which ones do you need help with?
If I was you, I would split the problem to several parts and deal with them one by one:
Hi,Ok in reality i need help on all the things, never did that and cant find too much information,
im trying to do it without any particular sharepoint classes, but doesnt seem to be possible, getting 403 unauthorized error
imageFilePathName = 'http link to png file in sharepoint'; (direct link to image...) new InteropPermission(InteropKind::ClrInterop).assert(); myWebClient = new System.Net.WebClient();myWebClient.Credentials = new System.Net.NetworkCredential("login", "password", "");
System.Byte fileData = myWebClient.DownloadData(imageFilePathName);
All right, so I suggest you focus on the first point only for now.
please make clear whether you mean SharePoint Online or on-premises SharePoint.
There is already support for SharePoint Online inside F&O, namely in document management (and electronic reporting, which utilizes document management). You may be able to reuse this logic.
For example, look at ERFileSourceSharePoint.appendFilesByDocuType():
proxy = this.getProxy(_docuType.Host, _docuType.Site);
FileResults fileResults = SharePointHelper::GetFiles(proxy, _docuType.FolderPath, '');
if (fileResults && fileResults.Results)
IEnumerable results = fileResults.Results;
var fileListEnumerator = results.GetEnumerator();
FileResult fileResult = fileListEnumerator.Current;
Investigating, will let you know does this SharePointHelper class can help doing that