re:
!I get the run time error
!Failed to map the path "ExternalMachineName/Folder1/Folder2"
!Any ideas, thanks ?
The account ASP.NET is running as,
needs access permissions to any shared folder in a different computer.
If the application resides on a UNC share, ASP.NET always impersonates
the IIS UNC token to access that share unless a configured account is used.
If you provide an explicitly configured account, ASP.NET uses that account in preference to the IIS UNC token.
To access a folder in an external machine,
you'll need to run ASP.NET as a network account with access permissions to that folder and its files.
Do that by configuring ASP.NET's identity in web.config :
<identity impersonate="true"
userName="domain\user"
password="password" />
Of course, you'll need to create a Windows account for "domain\user" on your server, and run:
aspnet_regiis -GA domain\user
....on the web server, so that the domain account has the necessary
permissions to all the directories on the server which ASP.NET needs access to.
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
======================================
"Paul" <Pa**@discussions.microsoft.comwrote in message news:90**********************************@microsof t.com...
Thanks for the additional information. I tried
If (File.Exists(Server.MapPath("~/Files/testfile.doc")))
where Files is a folder in my project and this works fine for what is above.
When I try it with a path that does exist to a folder on a different
machine, note without a file like
If (File.Exists(Server.MapPath("\\\\ExternalMachineNa me\\Folder1\\Folder2")))
I get the run time error
Failed to map the path "ExternalMachineName/Folder1/Folder2"
Any ideas, thanks ?
--
Paul G
Software engineer.
"Mark Rae [MVP]" wrote:
>"Paul" <Pa**@discussions.microsoft.comwrote in message
news:CE**********************************@microso ft.com...
>The problem is that there is no file actually called
"~/Files/newfile.doc" -
think about it...
Do you know if there is a way in the code to check if a path is just a
path
or if it is a file with out causing a runtime error?
if (File.Exists(Server.MapPath(".........")))
{
File.Delete(Server.MapPath("............."));
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net