Manipulating the local file system with browser-based JavaScript and Node

前端 未结 2 1781
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-03 09:20

I am making a project that needs to allow users to interact with the file system from a browser. I have a lot of experience writing client-side JavaScript, and I have a lot

2条回答
  •  悲&欢浪女
    2020-12-03 09:41

    You cannot do this purely in Javascript. Javascript running on browsers does not have enough permission yet (there have been proposals) due to security reasons.

    https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Introduction#restrictions

    Because the file system is sandboxed, a web app cannot access another app's files. You also cannot read or write files to an arbitrary folder (for example, My Pictures and My Documents) on the user's hard drive.

提交回复
热议问题