View Full Version : writing to a text file with javascript

06-19-2007, 04:25 AM
Hello I'm having trouble writing to a text file with javascript, i've tried writing to a local text file on my own PC, and I've also tried writing to a local file on my own server, (which I have all permissions to do so...)

I'd really like to write to a file that resides on my own web server.
Here is my code:

function WriteToFile() {

set fso = CreateObject("Scripting.FileSystemObject");
set s = fso.CreateTextFile("C:\test.txt", True);
<form onSubmit="WriteToFile()">
<input type="submit" value="Run the WriteToFile Function!">

quite frankly it just doesn't work, you know what I want to do, I gave you my attempt, please help me do it

thank you

06-19-2007, 05:03 AM
Why don't use rather some server side script language? Javascript is the client side script so don't try to perform some actions on the server side, ASP and PHP are the server side scripting languages and that's the right choice.