2

I'm aware of the JS Filesystem API for reading/writing files in the Chrome sandbox.

But I cannot find a W3C standard that does the same, is there a cross-browser way to read/write files on major browsers?

Thanks

4
  • No, because that would be a major security hole. You wouldn't want a website starting to write files into your filesystem. So vendor specific solutions exist, like the one you mentioned. IE uses ActiveX. But there is no general standard. Commented Feb 21, 2015 at 14:55
  • I meant reading/writing in a sandbox, not on the local filesystem of the user. Commented Feb 21, 2015 at 14:57
  • The W3C File System API standard has been discontinued, so probably not. Commented Feb 21, 2015 at 14:59
  • 2
    The only cross-plattform solution to save data persistently I'm aware of is local / web storage, specified here : w3.org/TR/webstorage. Commented Feb 21, 2015 at 15:01

1 Answer 1

1

It is recommended to use the Indexed Database API (large data, and a-synchronous) as the File System API is discontinued. Web Storage API can also work but it's synchronous and for small data.

Sign up to request clarification or add additional context in comments.

2 Comments

Can the Indexed Database API provide similar persistence guarantees? (I.e.: data will not be cleared without explicit action by the user).
@Alec yes they are persistent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.