views:

2559

answers:

4
+8  Q: 

HTML 5 File API

I hear that Firefox 3.6 adds support for the HTML local file API (Announcement here).

Does this mean that I can access local files from javascript?

Can anyone point me to examples for reading / writing local files?

I would love to be able to read / write simple text files.

Many thanks

+1  A: 

Take a look at the demo at hacks.mozilla.org.

Ruben
+1  A: 

You can find a (mozilla-specific explanation of the API on the Mozilla Development Center.

David Schmitt
+1  A: 

It doesn't allow accessing arbitrary local files. It's more of a file upload improvement. For instance, you can have some Javascript accept a drag-and-drop file initiated by the user of the browser.

You can find the W3C spec on it here.

Neville Flynn
+7  A: 

The only files you can access are files dropped from the desktop or files that has been selected from an <input/> tag. See the demo I've written here: http://hacks.mozilla.org/2009/12/uploading-files-with-xmlhttprequest/

Paul Rouget