0

The FileExists object keeps returning false even if I use the following:

If fso.fileExists(Server.MapPath(thumbfile)) Then %><img src="<%=thumbfile%>" /><% Else %><img src="./images/no-pic.gif" /><% End If %></div>

I am able to navigate to it locally. It is hosted on IIS6, what permissions are required on the server mapped directory?

To debug I did this:

<% Response.Write (Server.MapPath(thumbfile)) %>

This returned (which is valid):

\\101.101.101.123\docs\729\pic.jpg

The files are located on server 101.101.101.123 but IIS is on server 101.101.101.124

FileExists is still returning false.

<% Response.Write (thumbfile) %>

returns:

pdf/729/pic.jpg

Where PDF is a VIRTUAL DIRECTORY mapped to the listed path with Read/Write/Execute

\\101.101.101.123\docs
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
KayBee
  • 327
  • 1
  • 4
  • 9
  • [First mistake is using File.Exists() at all.](http://stackoverflow.com/questions/265953/how-can-you-easily-check-if-access-is-denied-for-a-file-in-net/265958#265958) – Joel Coehoorn Nov 21 '11 at 02:07

2 Answers2

0

I guess adding the following command in the user's logon script, who is set in "Log on As:" option of IIS service should resolve the issue.

net use x: \\SERVERNAME\SHARENAME
deenaik
  • 724
  • 7
  • 13
0

If you're using a UNC path mapped to a drive letter then this won't work. Although your interactive account has the drive letter mapped, the account that the website runs under most likely won't.

Mapped drive letters are account specific.

Kev
  • 118,037
  • 53
  • 300
  • 385