I need to download a file which is in SharePoint online programmatically. The link I have is in this format:
https://xxxxx.sharepoint.com/:f:/g/EkcBNxpXTKZJrg3xdBWlFBEBlgVj4FInALm_JVs4kYfK8w?e=tPfJVv
All the posts I can find refer to editing the URL from guestaccess.aspx to download.aspx, but that doesn't work for a URL in this format.
I'm trying to download the file in an AutoIT script, which will be available to a lot of users.
The link allows the file to be downloaded, but only by clicking the download button in Excel Online after the file is opened in a browser.
Is there any way I can do this? Amending the URL? Creating a different type of link in SharePoint? Or using any API?
string path = "https://xxxxx.sharepoint.com/:f:/g/EkcBNxpXTKZJrg3xdBWlFBEBlgVj4FInALm_JVs4kYfK8w?e=tPfJVv"; string downloadUrl = siteURl + "/_layouts/download.aspx?SourceUrl=" + path;