Solved

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

Posted on 2004-04-22
5
511 Views
Last Modified: 2007-12-19
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.
0
Comment
Question by:webtechy
  • 2
5 Comments
 
LVL 7

Expert Comment

by:dante469
ID: 10891677
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
0
 
LVL 2

Author Comment

by:webtechy
ID: 10892308
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.
0
 
LVL 7

Accepted Solution

by:
dante469 earned 250 total points
ID: 10892568
Forms authentication is used when running .aspx pages and is not used when loading non .Net pages...

Chances are you are not using impersonation because system would take on your UserID and perms when run so please;

In my example please replace NetHost with the name of your development machine and grant permission to the following userids on the FileFullPath  ("\\COMPUTER_NAME\FOLDER\FILENAME.PDF") file to:

\\NetHost\aspnet  
\\NetHost\IUSR_NetHost

Have Fun,
dante
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now