Skip to content Skip to sidebar Skip to footer

HTML5 Offline Storage. File Storage? Directories And Filesystem API

For storing data offline WebApp can use: session storage, 'advanced version of cookies' key/value based Web Storage (AKA local/global/offline/DOM storage) sql-based Web SQL Databa

Solution 1:

At last, I've found it! Here's the answer:

I’ll have the DOMFileSystem with a side of read/write access please wrote:

Eric Uhrhane of Google has been working on the working draft of the File API: Directories and System specification which defines a set of APIs to create a sandboxed filesystem where a web app can read and write data to.

Wow! I'm so excited!


Solution 2:

Why not use localStorage while the user is editing a document and the FileWriter API when they want to save it to disk? Most people are used to seeing a save dialog pop up when saving a document.

The only scenario I can think of that warrants userless access to the FileWriter API is an autosave feature, but autosaving to localStorage can be just as good.


Solution 3:

There is a way to save relatively large files to a users hard drive if you are willing to use Flash. Look into Downloadify:

http://www.bitrepository.com/downloadify-client-side-file-generation.html

Downloadify allows you to send data to a SWF and have that SWF create a file on the users machine. My recommendation would be to store the data via one of the methods you listed, Webstorage, sqlite database, etc. Put all your assets, including the SWF in the manifest file so everything is cached locally to the browser. You can then pull information from your db or webstorage and use the SWF to create the files you need.

I'm not sure if you will be able to read these files back into your web application.

Another option to save data is by using link tags with the data URI scheme. However, I'm not sure if it is supported in all the major browsers at the moment.


Solution 4:

For security reasons you can't write files to a user's local filesystem in case it gets used for nefarious purposes by evil people.

That's not likely to change, and that's a good thing.


Solution 5:

The HTML5 FileSystem API started landing in Chrome 8 and is fairly complete as of now (Chrome 11).

There's a nice tutorial on it here: http://www.html5rocks.com/tutorials/file/filesystem/


Post a Comment for "HTML5 Offline Storage. File Storage? Directories And Filesystem API"