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

R

Rickli Hansueli

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

open() ....writel(() ...close()..... ....save as ... c:\test.txt
thank you if you have an idea
Hansueli
 
I

Ivan Marsh

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

open() ....writel(() ...close()..... ....save as ... c:\test.txt thank
you if you have an idea
Hansueli

You shouldn't be able to from what I know.
That would violate the browser security.
 
V

Vjekoslav Begovic

Rickli Hansueli said:
javascript:
can I write to a local .txt File
as exaple:

open() ....writel(() ...close()..... ....save as ... c:\test.txt

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.");
myfile.Close();

Search Google for FileSystemObject for more information.

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

Vjekoslav
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top