开发者

FileSystemObject.FileExists returns false even if I map server path

开发者 https://www.devze.com 2023-03-06 16:18 出处:网络
The FileExists object keeps returning false even if I use 开发者_如何学运维the following: If fso.fileExists(Server.MapPath(thumbfile)) Then %><img src=\"<%=thumbfile%>\" /><% Else %

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


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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消