willcode.co
willcode.co

Reputation: 674

'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]

Upvotes: 10

Views: 5572

Answers (1)

willcode.co
willcode.co

Reputation: 674

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

Upvotes: 11

Related Questions