By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,694 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,694 IT Pros & Developers. It's quick & easy.

FileSystemObject question...

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
http://www.aspfaq.com/2168

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Steve" <la****@yahoo.com> wrote in message
news:0b****************************@phx.gbl...
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

Jul 19 '05 #2

P: n/a
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


-----Original Message-----
http://www.aspfaq.com/2168

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Steve" <la****@yahoo.com> wrote in message
news:0b****************************@phx.gbl...
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

.

Jul 19 '05 #3

P: n/a
> 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.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


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


-----Original Message-----
http://www.aspfaq.com/2168

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Steve" <la****@yahoo.com> wrote in message
news:0b****************************@phx.gbl...
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

.

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.