J
Jenny Shum
Hi!
I'm trying to write HTML parsed from an ASP page (by XMLHTTP object) into a
newly created .txt or .html file.
It gives me "Invalid procedure call or argument" error every time there is a
funny character on the ASP page (like ?, £, or some French alphabet chars)
Works fine with all other pages (containing no such characters).
Here is the code:
url = cStr("http://www.blah.com/blah.asp")
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send
SET myFSO = Server.CreateObject("Scripting.FileSystemObject")
If NOT myFSO.FileExists("D:\FOLDER\TextFile.txt") Then
myFSO.CreateTextFile("D:\FOLDER\TextFile.txt")
end if
If myFSO.FileExists("D:\FOLDER\TextFile.txt") Then
SET objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream = objFSO.OpenTextFile("D:\FOLDER\TextFile.txt",
fsoForWriting, True)
objTextStream.WriteLine xmlhttp.responseText
end if
Does anybody know how to encode the initial page to convert the wrong
symbols into something else please.
Thank you
Jenny
I'm trying to write HTML parsed from an ASP page (by XMLHTTP object) into a
newly created .txt or .html file.
It gives me "Invalid procedure call or argument" error every time there is a
funny character on the ASP page (like ?, £, or some French alphabet chars)
Works fine with all other pages (containing no such characters).
Here is the code:
url = cStr("http://www.blah.com/blah.asp")
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send
SET myFSO = Server.CreateObject("Scripting.FileSystemObject")
If NOT myFSO.FileExists("D:\FOLDER\TextFile.txt") Then
myFSO.CreateTextFile("D:\FOLDER\TextFile.txt")
end if
If myFSO.FileExists("D:\FOLDER\TextFile.txt") Then
SET objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream = objFSO.OpenTextFile("D:\FOLDER\TextFile.txt",
fsoForWriting, True)
objTextStream.WriteLine xmlhttp.responseText
end if
Does anybody know how to encode the initial page to convert the wrong
symbols into something else please.
Thank you
Jenny