Hi All,
I have created a PowerApp which lists files (mainly pdf files) located in Sharepoint using a Gallery Control.
Using PowerApps' Download(url) function with the Sharepoint Files 'Link to Item' I'm about to pop open this file into a new tab on the click of a button.
Is there a way to configure this so the file will just be downloaded on the click of a button immediately instead of opening in a new tab.
I've tried the above mentioned method and even the PDF Viewer control but both of those require the file to be opened in a new tab, then they are downloadable.
Cheers
Solved! Go to Solution.
Hi@Po5,
Could you please share your formula within the Download() function?
I have found that if you create a custom library to store files, you could use the following link to download directly:
Download("https://<site URL>/_layouts/download.aspx?SourceUrl=/sites/sitename/libraryname/filename.pdf")
This is an alternative solution that you should create a library to rename it as a custom library.
I have made a test that if you use the Documents by default as the Library to store your PDF files, there is no way to download the files directly clicking the download button. And for investigating, I recommend you open a ticket here. This will make you full understand why this link could not be used when you store your PDF files in the default library in SharePoint site.
Hope it could help you.
Regards,
Qi
Hi@Po5,
Based on the issue that you mentioned, do you want to download the PDF files directly from the SharePoint library?
Could you please share a bit more about the scenario?
Actually, the Download() function will make you download from the web to the local. It is by design that we could not avoid this when downloading.
In native players (Windows, Android, and iOS), the user is prompted for a location to save the file.
Your browser settings determine whether to download the file or open the file directly in a new tab.
For more details, please check Download function for reference.
In a word, I am afraid there is no way to download files directly without opening a new web in PowerApps currently.
Here is a similar idea you can refer to:
PowerApps Download file button (working or not)? - Power Platform Community (microsoft.com)
Hope it helps.
Regards,
Qi
Hi Qi,
Yes that's correct, at the moment I'm using the Sharepoint Connector and displaying a Gallery of items (which are the items in the Sharepoint Library). At the end of each row I've added a button that runs Download(ThisItem.'Link To File') when the button is selected.
ThisItem.'Link To File' gives a URL to the file in Sharepoint, an example would be https://mysp.sharepoint.com/sites/mylibrary/file.pdf.
What I'm looking for is a way to actually download the file on select of the button instead of it opening in a new tab and having the user download it from a different page (in essence this is an extra unneeded step).
At the moment let's limit this to web and take Windows, Android, iOS out of the equation.
I'm aware that there is also a Launch() function which effectively does the same thing as what's currently happening with Download() so just looking for alternatives so when the users using the app click download it actually downloads on first click.
Cheers
Hi@Po5,
Could you please share your formula within the Download() function?
I have found that if you create a custom library to store files, you could use the following link to download directly:
Download("https://<site URL>/_layouts/download.aspx?SourceUrl=/sites/sitename/libraryname/filename.pdf")
This is an alternative solution that you should create a library to rename it as a custom library.
I have made a test that if you use the Documents by default as the Library to store your PDF files, there is no way to download the files directly clicking the download button. And for investigating, I recommend you open a ticket here. This will make you full understand why this link could not be used when you store your PDF files in the default library in SharePoint site.
Hope it could help you.
Regards,
Qi
That workaround worked perfectly for me thanks!
User | Count |
---|---|
183 | |
124 | |
88 | |
45 | |
42 |
User | Count |
---|---|
248 | |
159 | |
127 | |
78 | |
73 |