
Announcements
Hi Folks,
I have a button in my canvas app which is part of a gallery. The gallery holds items from a collection (SPO list). The button holds the attachment of item. It displays the attachment name and onSelect should download it.
This works fine for word or excel documents like .doc, .xlsx etc. But when a pdf file is present, instead of downloading, it opens in browser with SharePoint URI shown in the URL section.
Could anyone help me to force download the pdf file without directly opening from SPO exposing the backend URL, or any method to encrypt the URL?
Thank you.
I was able to solve this issue by referring to below post:
Thanks @v-qiaqi-msft
Although in my case I was storing attachments in list items and was able to use the absolute URI of the attachment (SourceUrl=" & ThisItem.AbsoluteUri) which download the file directly.
Cheers.