Generated file not in directory ... :(
Hi All, I have the following code to generate a text file from Client side application. I changed my IE security to low ... so I won't get Error:"Automation server can't create object" ... however, I can't seem to find the file I created. I don't know what's wrong even though I tried to change the directory path to "http:\localhost\..." and it still doesn't work. Please help.
===============================
.....
<input id="btnUpdate" type="button" value="Update book info" onclick="updateBookInfo()"></input>
.....
function updateBookInfo()
{
createOrReplaceElement("Title", txtTitle.value, docBook.documentElement);
createOrReplaceElement("Publisher", txtPublisher.value, docBook.documentElement);
createOrReplaceElement("PubDate", txtPubDate.value, docBook.documentElement);
createOrReplaceElement("Abstract", txtAbstract.value, docBook.documentElement);
createOrReplaceElement("Pages", txtPages.value, docBook.documentElement);
createOrReplaceElement("ISBN", txtISBN.value, docBook.documentElement);
createOrReplaceElement("Price", txtPrice.value, docBook.documentElement);
renderElements();
addToFile();
}
.....
function addToFile()
{
var fso;
var tf;
var fi;
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("C:\Inetpub\wwwroot\XML\Book\Ch apter5_ClientSide\book.txt", true);
// Write a line with a newline character.
tf.WriteLine("Testing 1, 2, 3.") ;
// Write three newline characters to the file.
tf.WriteBlankLines(3) ;
// Write a line.
tf.Write ("This is a test.");
tf.Close();
}
....
|