admin管理员组文章数量:1345306
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
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
- 2 You could try giving them a link to the file, with the href pointing to a base-64 encoded data URI, perhaps? en.wikipedia/wiki/Data_URI_scheme – Michael Schuller Commented Jan 23, 2013 at 9:41
- 1 What's wrong about stackoverflow./questions/2897619/…? Should cover your problem entirely. – aefxx Commented Jan 23, 2013 at 9:47
- Was about to agree pletely. But I do not want to use flash at all. And I fear that data URI would be too restrictive - can I encode a 50mb file in a data URI? – willcode.co Commented Jan 23, 2013 at 9:52
1 Answer
Reset to default 11The 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
本文标签: javascript39Simulate39 file download in HTML5 web appStack Overflow
版权声明:本文标题:javascript - 'Simulate' file download in HTML5 web app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743742762a2531198.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论