Writing file to desktop using HTML5 FileSystem API

拈花ヽ惹草 提交于 2019-11-27 01:58:32
Paul Draper

Unfortunately, writing to regular files is not currently possible (despite the accepted answer Modifying Local Files Using HTML5 and JavaScript).

You can only write to the sandboxed filesystem.

FYI, you can do this in a Chrome Packaged App: http://developer.chrome.com/apps/fileSystem.html But even then the user must at least choose the file first. Writing to any file would be a serious security hole.

What problem are you really trying to solve?

Please note that Filesystem API is no longer part of the standard's specification, as specified at: http://www.w3.org/TR/file-system-api/

EDIT: Quoting the specification in case the link changes: "File API: Directories and System W3C Working Group Note 24 April 2014

Work on this document has been discontinued and it should not be referenced or used as a basis for implementation."

(This does not relate to the question directly, but it is essential to know not to use the FileSystem API further.)

Another link: http://www.html5rocks.com/en/tutorials/file/filesystem/

"In April 2014, it was announced on public-webapps that the Filesystem API spec should be considered dead. Other browsers have showed little interest in implementing it."

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!