By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,567 Members | 1,670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,567 IT Pros & Developers. It's quick & easy.

cannot write to a file using write()

P: 3
Expand|Select|Wrap|Line Numbers
  1. var textTobeWritten = blah();
  2.  
  3. var fso = new ActiveXObject("Scripting.FileSystemObject");
  4. var tempFile = fso.OpenTextFile(originalFilename, 2, true);
  5. tempFile.Write(textTobeWritten);
  6. tempFile.close();
  7. alert("done!! ");
  8.  
--------------------

i've a strange problem. I can actually do tempFile.write("XXX"); and it can be written successfully.

However, when I try to write textTobeWritten, which is mainly ANSI encoded characters, it will give me a "Invalid procedure call or argument, error code 0" on the line tempFile.write(textTobeWritten);

i am doing this on apache2.2.2 on a localhost. It was ok in the past with an older version of apache, but after i reinstalled apache, this problem came up.

can anybody please give me some advice on this??

thanks in advance...
Jul 5 '06 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Check the result returned by blah() and try it directly with the Write() method.

Failing that, check the documentation/examples.
Apr 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.