Accessing a file at a UNC

F

flipdoubt

I have an application that stores paths as UNCs in a database. I want ASP.NET
to move files from a UNC to a web accessible location, but I'm having the
hardest time getting the app to access the UNC even when the UNC points to
the machine running ASP.NET. What magical and voodoo must I perform to Access
a UNC from an ASP.NET application?
 
C

Craig Deelsnyder

I have an application that stores paths as UNCs in a database. I want
ASP.NET to move files from a UNC to a web accessible location, but I'm
having the hardest time getting the app to access the UNC even when the
UNC points to the machine running ASP.NET. What magical and voodoo must
I perform to Access a UNC from an ASP.NET application?

Make sure the aspnet user (the account asp.net is running as) has
read/write(/full control?) access to the folder shares in question.
 
J

JIMCO Software

Craig said:
Make sure the aspnet user (the account asp.net is running as) has
read/write(/full control?) access to the folder shares in question.

I personally wouldn't do that. If you do that, you are giving all
applications running on the box (or in the app pool on Win2003) full
control. Because ASPNET is a local account, you will also have to do a bit
of work to enable pass-through authentication if the UNC is on a different
box (which it will be in a real-world scenario.) The result is that you
have weakened your security.

A better idea would be to use impersonation. Using P/Invoke to impersonate
a user in code is the best option because it allows you to elevate
privileges temporarily and then revert back to a weak account.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;306158

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
P

Paul Clement

¤
¤ I have an application that stores paths as UNCs in a database. I want ASP.NET
¤ to move files from a UNC to a web accessible location, but I'm having the
¤ hardest time getting the app to access the UNC even when the UNC points to
¤ the machine running ASP.NET. What magical and voodoo must I perform to Access
¤ a UNC from an ASP.NET application?
¤

How you do this will depend upon the authentication level you have implemented for your web
application (Anonymous, Basic, Integrated Windows, etc.)


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top