How can I write a file to the client with JavaScript? - 01.30.02

John Zukowski



Basic security doesn't permit you to do this but, it possible to instantiate the FileSystemObject on the client side with IE and write files on the client's machine. Thankfully, there is a security warning.

var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:	estfile.txt", true);
a.WriteLine("This is a test.");