Accessing Files on a Network Share

  • Thread starter Thread starter Joel Barsotti
  • Start date Start date
J

Joel Barsotti

Currently I let people download files that the server knows they have
purchased.

I use Response.TransmitFile(filePath + "\\" + fileName) command

filepath is usually a network share like "\\\\storage-server\\fileshare"

Currently the only way I can figure to keep this working is to keep the
aspnet user password on both machines sync'd up, which is problematic since
patches often cause the ASPNET user account's password to regenerate.

Anybody have a good solution?
 
You can look at impersonation. Look at the last line.


<!-- AUTHENTICATION
This section sets the authentication policies of the application.
Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or
Integrated Windows) according to
its settings for the application. Anonymous access must be
disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter
their credentials, and then
you authenticate them in your application. A user credential
token is stored in a cookie.
"Passport" Authentication is performed via a centralized
authentication service provided
by Microsoft that offers a single logon and core profile services
for member sites.
-->


<authentication mode="Windows" />
<identity impersonate="true" userName="mydomain\johnSmith"
password="johnPassword" />
 
Hello Joel,


Just to add to sloan's post, read the detailed explanation there
http://west-wind.com/weblog/posts/1572.aspx


---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


JB> Currently I let people download files that the server knows they
JB> have purchased.
JB>
JB> I use Response.TransmitFile(filePath + "\\" + fileName) command
JB>
JB> filepath is usually a network share like
JB> "\\\\storage-server\\fileshare"
JB>
JB> Currently the only way I can figure to keep this working is to keep
JB> the aspnet user password on both machines sync'd up, which is
JB> problematic since patches often cause the ASPNET user account's
JB> password to regenerate.
JB>
JB> Anybody have a good solution?
JB>
 
Back
Top