...

View Full Version : Saving text in a text box as a .txt



RickyMason
08-03-2006, 12:46 PM
hi i was wondering how i could save text in a text box as a .txt on a click of a save button. I hope it is possibly so that it will finish my app off nicely

Reveller
08-03-2006, 03:03 PM
What you need is the FileSystemObject. A short example:


function WriteToFile(sText){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("C:\\test.txt", true);
s.WriteLine("helloworld");
s.Close();
}

sText obviously are the contents of the textarea; you will have to pass them to this function. And let the user choose where he wants to store the textfile. Happy coding :)

RickyMason
08-04-2006, 01:49 PM
thanks i hope this works



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum