Solved

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

Posted on 2004-04-22
5
513 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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