Trying to feed RSS with images, which works fine except where there is no image whereupon I get this error message:
"Microsoft VBScript runtime error '800a01a8'
Object required: '[object]'
/hbk/news.asp, line 85"
Line 85 = "response.write "<img src='" & cnodes(j).NodeValue & "' alt='image (0," & j & ")' class='floatLeft' width='200' />""
So then I tried to see if the image FileExists and got:
"Server.MapPath() error 'ASP 0173 : 80004005'
Invalid Path Character
/hbk/news.asp, line 110
An invalid character was specified in the Path parameter for the MapPath method."
Line 110 = "if fs.FileExists(server.mappath(fe)) = true then"
I then tried as many escape characters as I thought might be needed in the string: " and cut off everything after and including the question mark following the file extension, but I still get the same invalid character crap. Here's the offending code block:
I hope it's something dumb that I'm (not) doing. Anybody spot the error?
"Microsoft VBScript runtime error '800a01a8'
Object required: '[object]'
/hbk/news.asp, line 85"
Line 85 = "response.write "<img src='" & cnodes(j).NodeValue & "' alt='image (0," & j & ")' class='floatLeft' width='200' />""
So then I tried to see if the image FileExists and got:
"Server.MapPath() error 'ASP 0173 : 80004005'
Invalid Path Character
/hbk/news.asp, line 110
An invalid character was specified in the Path parameter for the MapPath method."
Line 110 = "if fs.FileExists(server.mappath(fe)) = true then"
I then tried as many escape characters as I thought might be needed in the string: " and cut off everything after and including the question mark following the file extension, but I still get the same invalid character crap. Here's the offending code block:
Code:
set fs=Server.CreateObject("Scripting.FileSystemObject")
imgorg = ""
imgorg = cnodes(j).NodeValue
imgvalue = ""
looper = 0
response.write imgorg
do while int(looper) < int(len(imgorg))
if mid(imgorg,looper+1, 1) = ":" then
imgvalue = imgvalue + chr(58)
elseif mid(imgorg,looper+1, 1) = "?" then
looper = len(imgorg)
elseif mid(imgorg,looper+1, 1) = "&" then
imgvalue = imgvalue + chr(38)
elseif mid(imgorg,looper+1, 1) = "/" then
imgvalue = imgvalue + chr(47)
elseif mid(imgorg,looper+1, 1) = "." then
imgvalue = imgvalue + chr(46)
elseif mid(imgorg,looper+1, 1) = "=" then
imgvalue = imgvalue + chr(61)
else
imgvalue = imgvalue + mid(imgorg,looper+1, 1)
end if
response.write imgvalue&" - '"&mid(imgorg,looper+1, 1)&"'<br>"
looper = looper+1
loop
response.write "<br>>>"&imgvalue&"<br>"
fe = imgvalue
if fs.FileExists(server.mappath(fe)) = true then
response.write "<img src='" & cnodes(j).NodeValue & "' alt='image (0," & j & ")' class='floatLeft' width='200' />"
end if
I hope it's something dumb that I'm (not) doing. Anybody spot the error?