\\server\file.ext does not like objFSO.FileExists()

B

Bob

When a file is local to the ASP application, I can use the following code to
test if the file exists:

Dim strFileName, blnFileExists, objFSO

strFileName = Server.MapPath( "\MyFiles\test.doc" )

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
blnFileExists = objFSO.FileExists( strFileName )
Set objFSO = Nothing

But if "MyFiles" resides on another server and I set up a virtual directory
in my ASP app to reference to it (e.g. "\MyFiles\test.doc" resolves to
\\server2\F$\MyFiles\test.doc), the code would return False even if the file
exists on the other server.

Is there a way to test the existence of a file that resides on another
server?
 
R

Ray Costanzo [MVP]

The user attempting to access the file needs to have permissions to get to
it. Under a normal setup MACHINE\IUSER_MACHINE doesn't rights to
\\OTHERMACHINE\Sharename, because OTHERMACHINE does not know who
MACHINE\IUSR_MACHINE is.

http://www.aspfaq.com/show.asp?id=2168

Ray at work
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top