When building applications using Power Apps, there are occasions where we need to display a large piece of information to the user (such as User Policy, Privacy Statement, etc) or allow users to download a template file so later they can submit for batch processing (such as template batch file for SAP processing). In this case, allowing users to download a file from web to the local device could be very useful.
Syntax and Examples
The Download function is a behavior formula, so it can be used in the OnSelect property of a label, button or other controls. The syntax is rather straightforward, with only one parameter which is the URL address of a web resource to download.
Download("URL")
Let’s try to put it in use to see what will happen. Create a button and write below formula in the OnSelect property:
Download("https://file-examples-com.github.io/uploads/2017/02/file-sample_100kB.doc")
When we play the app in the browser and click the button, the file will be automatically downloaded to our default downloads folder on our local device. Just like how we download files from other websites.

Since the Download function only locates the file based on the URL address, this leaves us the convenience of updating the file to be downloaded without changing any code in the Power Apps. We just need to update the file on the web, or even upload a new file with exactly the same name to replace the old file, as long as the URL address is still the same, we don’t need to change anything in Power Apps and users will always download the latest file. This is particularly useful for User Policy or Privacy Statement which will always have newer versions from time to time.
Different Behaviors Due to Devices or File Types
In Power Apps native players (Windows, Android, and iOS), the user is prompted for a location to save the file. When used on the web, Download is dependent on the browser’s settings to determine what happens with the file. For images, videos, and other file types that the browser natively supports, a new browser tab is opened to display the file.
Let’s see what this means. Play the app in a browser from a computer, using the same button but a different formula as below:
Download("https://file-examples-com.github.io/uploads/2017/10/file-sample_150kB.pdf")

When we click the button, instead of downloading the PDF file, the browser opens a new tab and display the pdf content in the browser. File types that can be natively supported by browsers will be opened instead of being downloaded. Some common types you may come across are PDF files, images, videos, audio, xml, etc.
One thing to note is that even for same kind of files, different file extensions may have different behaviors. For example, MP4 video file will be played in browser tab but AVI video file will be downloaded. The best way to know what would be the behavior for your selected file is simply to test it in the app.
Download("https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4")

Download("https://file-examples-com.github.io/uploads/2018/04/file_example_AVI_480_750kB.avi")
