开发者

Does HTML 5 allow to invoke save file dialog with file created in JavaScript?

开发者 https://www.devze.com 2023-02-12 16:30 出处:网络
Does HTML 5 al开发者_StackOverflowlow to invoke save file dialog with file created in JavaScript?Yes, but you don\'t really need HTML5 for it, what you can use is a Data URI.There are several limitati

Does HTML 5 al开发者_StackOverflowlow to invoke save file dialog with file created in JavaScript?


Yes, but you don't really need HTML5 for it, what you can use is a Data URI. There are several limitations, like IE8 only allows files up to 32Kb, and you'll need to get the user to click on a link. See my answer to a similar question for an example.

In the future you may be able to use the File Writer API, but I'm not aware of any browser support for that yet.


I've tested data-uri approach. Currently it works only in Firefox.

Seems that for now it is better to stay with flash: https://github.com/dcneiner/Downloadify

0

精彩评论

暂无评论...
验证码 换一张
取 消