Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-22
5
Medium Priority
?
519 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

926 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