jQuery.twFile

This jQuery plugin provides access to the local file system (for documents loaded from a file:// URI) to load and save file contents from the browser.

The code is based on TiddlyWiki's self-saving capabilities.

Note that the TiddlySaver applet is required on Opera and WebKit-based browsers (Safari, Chrome). The applet has to be present in the same folder as the respective HTML document.

Source

The source code is currently hosted in TiddlyWiki's Subversion repository.

Feedback is welcome.

API Summary

N.B.: All file paths must be absolute (e.g. /tmp/foo.txt or C:\temp\foo.txt).

(full documentation in the code comments)

Limitations

Internals

Internally, the plugin uses four separate drivers to implement the functionality on different browsers:

Demo

Download this document (and TiddlySaver if necessary) and open it from the local disk.

This demo illustrates self-saving capabilities by passing document.location.href to $.twFile.convertUriToLocalPath, using the return value in load and save functions.