Supported content-disposition headers
Content-Disposition: inline
Files with this header will be displayed directly in the app’s webview, similar to how HTML content is rendered.
- Ideal for PDFs and other media intended to be viewed in-app.
- You may need to use Native Navigation to provide navigation options for users to return to other parts of your app.
Content-Disposition: attachment
Files with this header will be automatically downloaded to the user’s device:
- iOS: Triggers the native “Share” dialog, allowing the user to open the file in the Files app or compatible apps.
- Android: Prompts the user with an “Open with” dialog after download.
Implementation guide
If you are not able to set theContent-Disposition header you may use the JavaScript Bridge downloadFile function to download (and open) a file on a user’s device. If you choose to open the file, the user sees the native iOS or Android Open with dialog.
URLs need to be publicly available. Localhost URLs are not supported.
Developer DemoYou can see the PDF viewer in action on our demo page https://median.dev/pdf-download
Download file at specified URL
Use the following command to download a file via the Median JavaScript Bridge: To download a file:- The file is downloaded and passed to the native “Open with” system dialog.
- Downloads Folder Enabled (Permissions tab): Downloads silently. If
open: trueis set, the “Open with” dialog is displayed. - Private to App Enabled (Permissions tab): Always shows the “Open with” dialog after download.
Save image to photos
To download and save an image to the user’s photo gallery (iOS Photos or Android Gallery), use:Viewing PDF files in the app
You can view PDF files directly within your app using one of the following methods: Option 1: Open via URLPrinting PDF files
If the device supports printing services, users can print PDF files directly from the viewer:- iOS: Tap the Print icon in the bottom-right corner of the PDF viewer.
- Android: Tap the Print icon in the top-right corner.

