can I write to a local .txt File wit javascribt?

Discussion in 'Javascript' started by Rickli Hansueli, Nov 20, 2003.

  1. javascript:
    can I write to a local .txt File
    as exaple:

    open() ....writel(() ...close()..... as ... c:\test.txt
    thank you if you have an idea
    Rickli Hansueli, Nov 20, 2003
    1. Advertisements

  2. Rickli Hansueli

    Ivan Marsh Guest

    You shouldn't be able to from what I know.
    That would violate the browser security.
    Ivan Marsh, Nov 20, 2003
    1. Advertisements

  3. Douglas Crockford, Nov 20, 2003
  4. No, not in the standard browser security environment.

    Lasse Reichstein Nielsen, Nov 20, 2003
  5. In the standard web environment no, but on your local PC you can, e.g.

    var fso = new ActiveXObject("Scripting.FileSystemObject");
    var myfile = fso.CreateTextFile("c:\\myfile.txt", true);
    myfile.WriteLine("Some test.");

    Search Google for FileSystemObject for more information.

    If you have some antivirus program, it may stop the script.

    Vjekoslav Begovic, Nov 20, 2003
  6. Rickli Hansueli

    Mark Szlazak Guest

    Mark Szlazak, Nov 21, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.