1

Possible Duplicate:
Is it possible to write to a file (on a disk) using JavaScript?

Is it possible to write file to file system, say C:\myfile\myfile.bin using Javascript?

I have this function:

var data = MyObject.getdata(); // typeof data = "object"

And I want to write "data" to a file for debugging purposes.

Community
  • 1
  • 1
quarks
  • 33,478
  • 73
  • 290
  • 513

2 Answers2

3

No but you can use new Local storage on HTML5 -

http://diveintohtml5.info/storage.html

localStorage.setItem("bar", Data);
Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
  • 5
    This will, in all probability, **not** write a file to the filesystem. In most browsers, it will merely create a row in a SQLite database. –  May 08 '12 at 17:10
  • 1
    So what? It's impossible to do what he asked for, so Dor is providing a perfectly valid, portable alternative. Why the downvote? – Blindy May 08 '12 at 17:15
  • 1
    Because it doesn't answer the question, which should be "No, but..." and maybe list how to access the data afterwards (since that's obviously required). – Andrew Leach May 08 '12 at 17:48
2

You can write file to the filesystem throw ActiveX, but it works only on Windows and only on IE.

kasper375
  • 171
  • 1
  • 5