質問

We can drag a file to browser and read it's content. But is there any way where we can write back to same file ?

役に立ちましたか?

解決

Short answer: No. The browser cannot arbitrarily write a file to the local file system. When a user drags a file onto the browser, this is user-driven action whereby the user's action grants the browser approval to access the file. However, that file is simply opened by the browser for read-only purposes; it cannot make change and save it back.

The "File System API" does not provide read/write access to the client/local file system. This is probably the biggest misunderstanding about the File System API, probably because the name of the API give the impression that it can do something it really can't.

I covered this more fully in my reply on JS Filesystem API: accessing JS FileEntry's on local system?.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top