Viewing Files with Google Gears

| 0 Comments | 0 TrackBacks

Something that web developers have been looking for, but haven't been able to do, is now possible with Google Gears. Namely, accessing a file from JavaScript. It still isn't possible to access an arbitrary file, but with Gears, you can access the contents of a file that the user has selected in a file input element.

The following function assumes the Prototype library.

Given a file input element (DOM reference), the url at which to store the file in the local file store, and a callback to call with the content of the file, it will retrieve the content of the file from the local disk.

No TrackBacks

TrackBack URL: http://www.jamesgottlieb.com/cgi-bin/mt-tb.cgi/9

Leave a comment

Recent Entries

Fabulator Design: RDF Operations
If you’re familiar with MVC design, or at least with Ruby on Rails, then you’ve heard of CRUD: create, read,…
Fabulator: the Future of Gestinanna
In a post from quite a while back, I talk about eXtensible State Machines, a way to reduce a web…
The Church of Latter Day Scholars
Michael Godwin, General Counsel, Wikipedia Foundation, is on campus today visiting with various digital humanities groups and giving a talk…