473,472 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Binary Download of Files from another internal Server

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

Nov 17 '05 #1
3 1328
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/de...ersonation.asp

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

"Frank Hofmann" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
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

Nov 17 '05 #2
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

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
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/de...ersonation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Frank Hofmann" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
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


Nov 17 '05 #3
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 yourprocess 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
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in messagenews:up**************@TK2MSFTNGP12.phx.gbl...
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/default.asp?

url=/library/en-
us/cpguide/html/cpconaspnetimpersonation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able- consulting.com
"Frank Hofmann" <an*******@discussions.microsoft.com> wrote in message news:02****************************@phx.gbl...
> 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
>


.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steve Troxell | last post by:
I am trying to use ServerXMLHTTP in an ASP page to return a binary file download to the browser. It works just fine with small files ( under 1 MB) but seems to fail with large files (4 MB, 11 MB in...
6
by: alice | last post by:
hi all, Can anybody please tell the advantages which the binary files offers over the character files. Thanks, Alice walls
4
by: knapak | last post by:
Hello I'm a self instructed amateur attempting to read a huge file from disk... so bear with me please... I just learned that reading a file in binary is faster than text. So I wrote the...
10
by: Fabuloussites | last post by:
I'm considering deploying an application that will us an IP address locaiton database provided by Ip2location.com... http://www.ip2location.net/ip2location-dotnet-component.aspx their .net...
6
by: Barry | last post by:
Hi all I have this script(download.php) which downloads binary data from a mysql database. <? /* SNIP */ $document=document::singleton();
68
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.