Accessing Files on a Network Share

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?
 
S

sloan

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" />
 
M

Michael Nemtsev

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>
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top