4

I need to allow users of my Web App to save files in their local file system after working on an editor implemented with javascript ( to work on a browser ) I heard about FileWriter API in HTML5, but not sure if it is supported in any of the Firefox versions, particularly FireFox 5.

Does anyone have any alternatives apart from Server side processing to allow users to save files into their local filesystem ( ofcourse with a permission from the user ) in FireFox. As I read Google Chrome supports FileWriter API though am not been able to make it work yet.

Raks
  • 1,723
  • 3
  • 18
  • 26
  • Hi! Currently I'm trying to do that. Did you find a solution? – raultm Jul 01 '11 at 09:00
  • No could'nt get a solution for writing file locally – Raks Jul 01 '11 at 15:49
  • 1
    Take a look at this [answer](http://stackoverflow.com/questions/6551253/saving-string-of-data-as-a-file-with-html5-javascript-without-using-uri/6551337#6551337). – david Jul 01 '11 at 17:41
  • thanks david, I read your answer before. It's not the perfect answer for me(us) but I vote up. If i found something I'll post it. I going to give a chance to URI Specs. – raultm Jul 04 '11 at 09:55

2 Answers2

5

FileWriter is a Google working draft

Firefox team is working on implementing FileWriter also: https://bugzilla.mozilla.org/show_bug.cgi?id=557540

unxed
  • 196
  • 1
  • 3
  • 6
4

No, Firefox does not support FileWriter, and the standardization of this API was abandoned (1, 2). http://www.w3.org/TR/file-writer-api/ now states:

Work on this document has been discontinued and it should not be referenced or used as a basis for implementation.

It seems that that API didn't even provide the feature you seem to be looking for:

The API doesn't give you access to the local file system, nor is the sandbox really a section of the file system. Instead, it is a virtualized file system that looks like a full-fledged file system to the web app. It does not necessarily have a relationship to the local file system outside the browser.

What this means is that a web app and a desktop app cannot share the same file at the same time. The API does not let your web app reach outside the browser to files that desktop apps can also work on.

You could use localStorage or IndexedDB to store the data client-side, albeit not in an arbitrary file the user can select via filepicker.

You could write an extension that provides the necessary API to content JS. As of 2015, it's unclear which technology you should use for that.

Downloadify (Adobe Flash initiating a download) is also often mentioned when discussing this. This thread mentions an alternative based on data: URIs.

Community
  • 1
  • 1
Nickolay
  • 31,095
  • 13
  • 107
  • 185