Solved

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

Posted on 2004-04-22
5
517 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 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