简体   繁体   中英

'Simulate' file download in HTML5 web app

Say I have a webapp which executes in its entirety on the client-side. Its purpose is to act as a file conversion utility, for example converting a user's local stored word document into a PDF.

So with the user's permission, the app can read a specified local file and process it, in memory, into PDF format.

How can I get the user to 'download' the result? since the data is held in the browser's memory anyway, I do not wish to upload it to some server.

[edit]

  • No flash based solutions
  • Expected file sizes to be up to 15mb

The solution for my case will be to use the HTML5 FileSaver API.

Perhaps this question should just be closed as it is effectively a duplicate of

Using HTML5/Javascript to generate and save a file

Thanks to aefxx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM