Hi all,
Please your help urgently.
I am currently having difficulties trying to write to a shared drive on an intranet network in windows vista using javascript FileSystemObject.
the code is as follows:
<html>
<script language='JavaScript'>
function WriteToFile() {
try {
var fs,s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.CreateTextFile("\\*****\Nosike\\Logfileee.txt " ,8,true);
s.writeline("name|email|location|comments");
s.writeline(document.data.name.value + "|" + document.data.email.value + "|" + document.data.location.value + "|" + document.data.comments.value);
s.Close();
}
catch(err){
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}
}
</script>
<body>
<form action="test.hta" method="post" name="data">
Name: <input type = "text" name="name"><br>
Email: <input type="text" name="email"><br>
Location: <input type = "text" name="location"><br>
Comments: <textarea name="comments"> </textarea><br>
<input type=button value="Submit Data" OnClick="WriteToFile(this.form)">
</form>
</body>
</html>
Looking forward to your help.
Thanks
Please your help urgently.
I am currently having difficulties trying to write to a shared drive on an intranet network in windows vista using javascript FileSystemObject.
the code is as follows:
<html>
<script language='JavaScript'>
function WriteToFile() {
try {
var fs,s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.CreateTextFile("\\*****\Nosike\\Logfileee.txt " ,8,true);
s.writeline("name|email|location|comments");
s.writeline(document.data.name.value + "|" + document.data.email.value + "|" + document.data.location.value + "|" + document.data.comments.value);
s.Close();
}
catch(err){
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}
}
</script>
<body>
<form action="test.hta" method="post" name="data">
Name: <input type = "text" name="name"><br>
Email: <input type="text" name="email"><br>
Location: <input type = "text" name="location"><br>
Comments: <textarea name="comments"> </textarea><br>
<input type=button value="Submit Data" OnClick="WriteToFile(this.form)">
</form>
</body>
</html>
Looking forward to your help.
Thanks