FileSystemObject question...

S

Steve

Hi all,

FileSystemObject question...

I'm trying to check if files exist or not, but the files
are not sitting on the same server as our Intranet.
Basically we have about 5000 photos in a directory on our
database server, and they must stay there. I want to use
the FileSystemObject (running on our Intranet server) to
check if a photo is there, if so display it, if not
display a 'no image' graphic.

Within IIS I've created a virtual directory
called 'staffpics' which looks at the hidden share for the
photos: \\servername\sharename$

This works fine displaying the photos in IE:
intranet.domain.co.uk/staffpics/117495.jpg

But when I try to check if the file exists using the
FileSystemObject:

CheckThisFile = Server.MapPath("/staffpics/117495.jpg")
Set filesys = CreateObject("Scripting.FileSystemObject")
Response.Write filesys.FileExists(CheckThisFile)

I get "False", but I know the file is there and accessible.

Any help with this would be great, even if it's not using
the FileSystemObject...!

Thanks,

Steve
 
S

Steve

Thanks Aaron,

But I don't think I have any network access problems, I
can map a drive to the share, I can view the photos via
the virtual directory in IE, all I can't do is check if
the file (.jpg) exists using the FSO.

As I mentioned, I need to use ASP/VBScript to check if an
individual has a photo, if so display it, if not display
a 'no photo' image.

I really appreciate your help, any other ideas..?

Steve
 
A

Aaron Bertrand - MVP

But I don't think I have any network access problems, I
can map a drive to the share, I can view the photos via
the virtual directory in IE, all I can't do is check if
the file (.jpg) exists using the FSO.

That's because *YOU* are logged on as *YOU.* When your ASP script runs, it
runs as *IUSR*, not *YOU*. Hence, http://www.aspfaq.com/2168

Please read the article *thoroughly* before you decide it couldn't possibly
apply to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top