javascriptfilesystemscross-browserhtml5-filesystem

Browser-side JS: File System API vs File System Access API?


There was a File System API but shown as deprecated now:
https://developer.mozilla.org/en-US/docs/Web/API/Window/requestFileSystem

There is now another, File System Access API:
https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API

What happened to the old API and why was it discontinued? Should the new File System Access API be stable in all common browsers?


Solution

  • It turned out that File System Access API is not deprecated, it's just not standardised (May 2021); the deprecated one is the function window.requestFileSystem; the same function on Chromium-based browsers is window.webkitRequestFileSystem.

    File System API is for creating a virtual drive (temporary or persistent) for each website when using browser-based db (IndexedDB) is not necessary especially for the purpose of storing files.
    https://developer.mozilla.org/en-US/docs/Web/API/FileSystem

    File System Access API is different, it is for accessing the real file system of the OS. This API is now standardised and available on Chromium-based browsers (May 2021). Firefox has not yet adapted this API.
    https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API

    Status of these APIs: https://developer.mozilla.org/en-US/docs/Web/API