Native File Downloader

Add a download button that saves files to your user's device and shows the share menu.

Written By despia

Last updated About 1 year ago

SDK Usage

window.location.href = "https://example.com/file.pdf"

That's it! This one line:

  • Downloads the file

  • Opens the share menu

  • Works with any file type

Examples

Download Images

window.location.href = "https://example.com/photo.jpg"

Download PDFs

window.location.href = "https://example.com/document.pdf"

Share Files

// Works with any URL that points to a file
window.location.href = "your-file-url-here"

Tips

  • Make sure your file URL is valid and accessible

  • Add a loading indicator for big files

  • Test your download links before going live


Need help? Email us at support@despia.com