Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting.FileSystemObject stopped working

Status
Not open for further replies.

ardan

Technical User
Apr 22, 2003
27
US
Hi All,

I have a problem that I just cannot figure out, hope someone has an idea... I use IIS with xp pro for in office work. I have an asp page that display PO images, I used the following code to display a image if it is there. Any Ideas why it doesn't work???

<%dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("/images2/" & (RS.Fields.Item("Ponumber").Value) & "2.jpg") Then
Response.write "<H3></h3>"
Response.Write("Page 2")%>
<p><img src=<%=picvar2%></p><br>
<%End If%>

* picvar2 contains full path to image (tested it works)
* /images2/ is visible from the web site..
Outside the if ("/images2/" & (RS.Fields.Item("Ponumber").Value) & "2.jpg") works
and Outsite the if <img src=<%=picvar2%> Works


Short version the IF command just doesn't work, no error it just iqnores the entire if statment...

any ideas???

Thanks,

Ardan


End of Line
 
Where is /images2/ exactly located?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
sorry, I forgot to state that. /images2/ is located on the same computer as IIS, it is a different drive "d:\images\". The web server can see images2 because is I put in IP/images2 it displays the directory.

Could this be some kind of permissions problem??

Thanks,

End of Line
 
FSO doesn't work with web paths, only drive paths. That said, "/images2/" is very probably assumed as "c:\images2\" (c = current drive).

Can you use server.MapPath() to convert web to drive path?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top