Download Files
<a href="download-url?wtn-download-file=true"> download File</a>
or
window.location.href = "download-url?wtn-download-file=true";For example
For video - blob:https://video_url?filename="abc.mp4"
For image - blob:https://image_url?filename="myImage.png"
For pdf - blob:https://pdf_url?filename="document.pdf"You'll need to import the javascript file in your website.
<script src="https://unpkg.com/[email protected]/webtonative.min.js"></script>
window.WTN.downloadBlobFile({
fileName:"your_file_name.pdf",
downloadUrl:link_to_the_file,
shareFileAfterDownload: true,
openFileAfterDownload: false
})
Pass the filename and blob file url for example - blob:https://pdf_url
shareFileAfterDownload - Opens the share option
openFileAfterDownload - opens the file in a window inside app
Function added on 06/08/2024
Function updated on 02/02/2026Last updated