Spudhead
08-12-2003, 12:44 PM
Hey,
OK, this question has 2 parts. 5 points for each successful answer ;)
I've got a quick function that uses FileSystemObject to make sure an image (filename pulled from SQL Server) exists. Roughly:
If (objFSO.FileExists(Server.MapPath(FileName))) = True Then
IsFileExists = True
Else
IsFileExists = False
End If
Pretty basic :) This is falling over on ONE image - the FileName variable passed to the function is "images/Gen_Bali_View_2.jpg", and the error is "An invalid character was specified in the Path parameter for the MapPath method." For the other 9000 images, it works fine....
So - question 1 is: what invalid char would be causing such an error?
The second question centers around my as-yet-unsuccessful attempt at an another approach: the XMLHTTP object. I'm trying to use the following:
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", strPicPath, False
objXMLHTTP.Send
intHTTPStatus = objXMLHTTP.status
Set objXMLHTTP = Nothing
If intHTTPStatus = 200 Then
IsFileExists = True
Else
IsFileExists = False
End If
Which is falling over on "objXMLHTTP.Send" with a "cannot find remote server" error.
The "strPicPath" variable that's passed to it is the full url of the image (which isn't on a remote server, it's actually in the directory below the file containing the above code snippet). The URL is valid when pasted into a browser.
So - question 2 is: am I using XMLHTTP in a completely misguided way, or do I simply have a bit of a typo?
Thanks :)
OK, this question has 2 parts. 5 points for each successful answer ;)
I've got a quick function that uses FileSystemObject to make sure an image (filename pulled from SQL Server) exists. Roughly:
If (objFSO.FileExists(Server.MapPath(FileName))) = True Then
IsFileExists = True
Else
IsFileExists = False
End If
Pretty basic :) This is falling over on ONE image - the FileName variable passed to the function is "images/Gen_Bali_View_2.jpg", and the error is "An invalid character was specified in the Path parameter for the MapPath method." For the other 9000 images, it works fine....
So - question 1 is: what invalid char would be causing such an error?
The second question centers around my as-yet-unsuccessful attempt at an another approach: the XMLHTTP object. I'm trying to use the following:
Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "GET", strPicPath, False
objXMLHTTP.Send
intHTTPStatus = objXMLHTTP.status
Set objXMLHTTP = Nothing
If intHTTPStatus = 200 Then
IsFileExists = True
Else
IsFileExists = False
End If
Which is falling over on "objXMLHTTP.Send" with a "cannot find remote server" error.
The "strPicPath" variable that's passed to it is the full url of the image (which isn't on a remote server, it's actually in the directory below the file containing the above code snippet). The URL is valid when pasted into a browser.
So - question 2 is: am I using XMLHTTP in a completely misguided way, or do I simply have a bit of a typo?
Thanks :)