I am using the following piece of code and it works perfectly fine when used locally, but can it be used for server purposes??
function WriteToFile(data) {
var currentdate = new Date();
var datetime = "Time: " + currentdate.getDate() + "/" + (currentdate.getMonth()+1) + "/" + currentdate.getFullYear() + " @ " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds();
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.OpenTextFile("C:\\logs\\log.txt", 8);
a.WriteLine(datetime);
a.WriteLine(data + "\n");
a.Close();
}
I've tried everything for the path to the txt file in my Z: drive with no luck whatsoever. Is this even possible? I've also granted access to "Everyone" to the folder so it can be readable and writeable but still I cannot open the txt file to edit it. For the record I am using IE8.
Any suggestions?