0

I'm wondering.. how could I output a string to a file (and create said file) in javascript?

I'm using this for Chrome extension development.

1
  • 2
    A little more context please. Where's this file supposed to be written? Are you talking about Javascript running in a browser? Commented Jan 26, 2011 at 10:32

3 Answers 3

1

You can't create, read, or modify files on the computer using browser based client side Javascript for security reasons.

Sign up to request clarification or add additional context in comments.

Comments

0

If you want to do this from within a browser, it won't work except you might use activex or java (via plugins).

Or you fetch yourself the spidermonkey (mozilla's javascript engine) source code and compile it into a command line application. You will get file access this way.

Cheers, -S

Comments

0

You post the info to a http handler (ashx in asp.net, or just a php site), which then writes the info to a file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.