Binary Download of Files from another internal Server

  • Thread starter Thread starter Frank Hofmann
  • Start date Start date
F

Frank Hofmann

Hi there,

I'm new to .Net and programming of web sites. But I have
to build a solution which can do the following:

Only authorized people can connect to a specific site.
They have to login with user name and password. This works
fine with the authenticated forms feature of ASP.NET.

The site itself should provide the download of WAV files.
It is very important, that the files can not be downloaded
by people who have no access to it. The downloading itself
is no problem, after I found some samples (Q306654) in
TechNet and some forums. If the WAV files are located
somewhere on the local HDD but not beneath the wwwroot
folder there won't be a problem.

The problem is now that the WAV files and the IIS where
the ASP.NET is running are on different machines. Of
course I could change the ASP.NET and / or IIS Service
Account to a network user, but I think this is a security
issue and so I don't' want to do this. But I haven't found
a way to connect to a network location - like I would do
with "net use \\server\share /user:domain\user"

Can anyone tell me how I should to this? Maybe I'm totally
wrong and I should use a complete different approach to
build this solution?

Thanks in advance.

Frank Hofmann
 
You're definitely on the right track I'd say.
It sounds like the last piece of the puzzle you need is impersonation.
This will allow your web app to run under another user account besides the
default ASPNET user account.
You want it to run under a user account that has network privilages to the
network share.
For initial testing you can have it run under your user account.
Ultimately you may want to make a new user account for use only by your web
app.
Here's more info on impersonation:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp
 
I should add that you'll also need some code similar to this once your
process has the necessary network permissions:
Response.AddHeader("Content-Disposition","inline;filename=somefile.mp3");
Response.WriteFile("\\someserver\somefile.mp3");

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
 
Thank you very much, Steve. This helps me realy.
-----Original Message-----
I should add that you'll also need some code similar to this once your
process has the necessary network permissions:
Response.AddHeader("Content- Disposition","inline;filename=somefile.mp3");
Response.WriteFile("\\someserver\somefile.mp3");

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com



use only by your
web
url=/library/en-
us/cpguide/html/cpconaspnetimpersonation.asp


.
 
Back
Top