Link to home
Start Free TrialLog in
Avatar of webtechy
webtechy

asked on

Dim f As New IO.FileInfo(FileFullPath) Return f.Exists [Gives false for file on a network)

Dear All,

I am doing:

            Dim f As New IO.FileInfo(FileFullPath)
            Return f.Exists

However, if:

FileFullPath = "\\COMPUTER_NAME\FOLDER\FILENAME.PDF"

Which lets says exists on my network, I am getting f.Exists as false, although the machine I am running this on can open that file if I go to Start > Run. Is this a permissions thing? Do I need the ASP.Net account on this machine to have read access to the files on that server?

Any help much appreciated.

Thanks,

Ben.
Avatar of dante469
dante469

Please remember this command is executed on the IIS server as part of .Net and not on the local machine...

Depending on your security you will need to grant permissions to the FileFullPath as follows;

Application user's userid 'Needed if using impersonation...  
\NetHost\aspnet  ' Needed if using windows authentication
\\NetHost\IUSR_NetHost 'Needed if using anonymous authentication

Have Fun,
Dante
Avatar of webtechy

ASKER

The site is using Forms authentication.

I am running the site on my development machine, i.e. the IIS of the site is on my machine, however, the files are located in another machine.
ASKER CERTIFIED SOLUTION
Avatar of dante469
dante469

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial