It is my understanding that the PDF viewer does not support viewing PDFs stored in a SharePoint library -- and the capability request has been in the development pipeline for a very long time (and I am not going to wait for it to happen).
In lieu of that ideal design, I'd like to give users the option to download a PDF file that is stored in a SharePoint library and am running into an issue where:
(1) the download works fine using the PowerApps "Preview the app (F5)" feature, but
(2) it gives an error when using mobile: "The URL passed to the function is not valid", and
(3) it fails when running in Dynamics 365, with the message "Failed - No file".
My OnSelect [fx] function reads:
Download(ThisItem.One_x0020_Pager)
Where ThisItem.One_x0020_Pager is a SharePoint list column containing a URL of a PDF stored in a SharePoint library.
Am I doing something wrong here, or is downloading from SharePoint libs also unsupported??
Solved! Go to Solution.
Hi @grhaberer,
This is by design.
It works on Desktop as the user may be logged into the browser already and hence the url works. This will not work on mobile as PowerApps doesn’t know how to get the file from SharePoint.
You have two options:
Regards,
Mona
Hi @grhaberer,
I just tested and got the same result as yours. Notice that the URL of SharePoint library files was something like "https://xxxx.sharepoint.com/sites/TeamSite/Library1/test2.xlsx". The URL has to specify the file extension as the http://path.
This will work on a desktop, after clicking on the button, user is prompted for a location to save the file.
But on mobile, it will show the error. (Sorry that my mobile system is in Chinese version.)
I will report this to the pg and see if they have any suggestion. Thanks for pointing this out.
Regards,
Mona
Hi @grhaberer,
I should also mention that I cannot reproduce your issue about the Dynamics 365 site part. When I use the app from web browser, with excel/word file, the browser will pop up the option to download the file, but with PDF file, it will directly open the PDF file.
Formula I'm using:
Download(ThisItem.SharePointSiteURL)
Regards,
Mona
Hi @grhaberer,
This is by design.
It works on Desktop as the user may be logged into the browser already and hence the url works. This will not work on mobile as PowerApps doesn’t know how to get the file from SharePoint.
You have two options:
Regards,
Mona
This used to work on my Android device, but has since stopped working.
I have a SharePoint online document library with PDFs stored in it. There are a number of meta data fields on each file. I have a PowerApp with a view gallery which is loading rows from the library. By including a PDF image on each gallery item I am able to use the OnSelect action on the image combined with the Launch(ThisItem.'{Link}') function to launch the browser and open the file in the browser. For months this was working but recently this has stopped (so far on Android, this doesn't seem to be an issue on iOS).
Now when attempting to launch the file, it starts to open and either;
1. attempts to open in a PDF viewer which fails with the error: "Cannot display pdf (filename.pdf can not be opened)"
2. attempts to open in a PDF viewer which fails with the error: "Error. The file could not be downloaded. Please save the file to your local strorage and then try to open it."
3. loads it in the browser which then downloads the file locally without displaying it
Is there any way that this behaviour can be changed? I desperately need the files to be accessible on mobile and they need to open in the browser (if the PDF viewer isn't going to support SharePoint or OneDrive files).
But PDF is open in browser then getting download option, we can not directly save PDF file in our local system?
Anyone got the solution to download the pdf directly on button click instead of opening in browser?
User | Count |
---|---|
170 | |
95 | |
76 | |
72 | |
59 |
User | Count |
---|---|
215 | |
166 | |
97 | |
95 | |
74 |