Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > \\server\file.ext does not like objFSO.FileExists()

Reply
Thread Tools

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

 
 
Bob
Guest
Posts: n/a
 
      04-26-2005
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?


 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      04-26-2005
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

"Bob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PC does not start and does not turn off sean Computer Support 3 12-28-2006 10:37 AM
object-like macro used like function-like macro Patrick Kowalzick C++ 5 03-14-2006 03:30 PM
Can you use ASP ADO "Like" to perform a "Not Like" search? Adam Short ASP General 2 04-14-2005 01:20 PM
Power button does not turn OFF? New power supply does not help! win2k lbbss Computer Support 0 01-06-2005 04:03 PM
Webservice works once and then DOES NOT seem to work even though program does not crash Phi! ASP .Net Web Services 1 04-23-2004 08:42 AM



Advertisments