Connecting Tech Pros Worldwide Help | Site Map

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

Rickli Hansueli
Guest
 
Posts: n/a
#1: Jul 20 '05
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


Ivan Marsh
Guest
 
Posts: n/a
#2: Jul 20 '05

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


On Thu, 20 Nov 2003 18:46:56 +0100, Rickli Hansueli wrote:
[color=blue]
> 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[/color]

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


--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.

Lasse Reichstein Nielsen
Guest
 
Posts: n/a
#3: Jul 20 '05

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


"Rickli Hansueli" <rickli@rickli.com> writes:
[color=blue]
> javascript:
> can I write to a local .txt File[/color]

No, not in the standard browser security environment.

/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Douglas Crockford
Guest
 
Posts: n/a
#4: Jul 20 '05

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


> can I write to a local .txt File

Perhaps you meant "JavaScript"? Yes, in the right runtime environment.
Here are two environments that can:

Sash: http://sash.alphaworks.ibm.com/
WSH:
http://msdn.microsoft.com/library/de...ScriptHost.asp

The webbrowser environment does not ordinarily permit this.

http://www.crockford.com/#javascript

Vjekoslav Begovic
Guest
 
Posts: n/a
#5: Jul 20 '05

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


"Rickli Hansueli" <rickli@rickli.com> wrote in message
news:3fbcfdfd$1_1@news.bluewin.ch...[color=blue]
> javascript:
> can I write to a local .txt File
> as exaple:
>
> open() ....writel(() ...close()..... ....save as ... c:\test.txt[/color]

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


Mark Szlazak
Guest
 
Posts: n/a
#6: Jul 20 '05

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


A previous post shows an IE only method, if you want to do the same
thing in Mozilla or Netscape 7 then have a look at this tip:

http://www.faqts.com/knowledge_base/...d/23360/fid/53







*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread