Announcements
Download fucntion opens the given link in browser instead of downloading the document.Syntax: Download(link to item)How to directly download without opening the link ?
Hi @abhishek_123 ,
Please try this:
Launch("https://<domain>.sharepoint.com/sites/<Site Name>/_layouts/15/download.aspx?SourceUrl=/sites/<Site Name>/"&ThisItem.'Full Path')
For example:
Hope this helps.
Sik
This shows a error. My files are inside the shared documents
Yes, my test and codes work well for the sharepoint document files.
It looks like that you defined a wrong <SiteName> and <Domain> in the launch URL. Could you please share the code in your scenario?
When you open the sharepoint documents page, you can find the link shown as below
Hi @v-siky-msft I have One gallery connected to sharepoint documents which as a download icon, onSelect porperty of the icon I used the code which you suggested. I found the issue is when I Filter the Documents in items porperty of Gallery and click on download icon it opens a new tab and throws File not found error.If I directly pass the Documents without filter in gallery items then the file gets downloaded properly, but in my requirement I have to filter the documents as per the given path:Eg: Filter(Documents,'Folder path'="Some Path/")Not sure why this happens, If you find a solution please let me know.
Could you share two complete launch links? one for success, one for failure.
I want to check if there is any difference between two link.
Hi @v-siky-msft There is no change in link code, only change I make is with the filter in items property of gallery even This.path returns Exactly same path for both the scenario.You can test in but just adding a filter to the galley and then try the link to download
Yes, I have tested, and it all works perfect. Please see the GIF.
I find the error only happens when you are trying to download the Folder.
Hence, I think you need to provide more information to help me reproduce your issue.
Hi @v-siky-msft I found the issue was the folder name had "&" symbol in it when it is passed in url it shows error.My folder name was "Logo & Branding", this was the issue and than i changed it to "Logo and Branding" Now it workes fine,
Thank you for helping
EDIT: I solved my own problem, in the second 'Site name' I didn't actually have the site name, I had the folder name!
Hi @v-siky-msft ,
Sorry for hijacking this thread however I cannot get this to work at all. I've created my URL as you've suggested above but I am still getting an error message.
I may need a slightly different solution because I am pulling my sharepoint files from a flow rather than directly from the sharepoint site itself but all the information is there as you have above.
Please see my URL below:https://<domain>.sharepoint.com/sites/<site name>/_layouts/15/download.aspx?SourceUrl=/sites/<site name>/<folder name>/<file name with extension>
Its work fine... just does any one have the solution to download folders using this??
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 358 Most Valuable Professional
11manish 214 Super User 2026 Season 2
Mohsin Ali 185