473,624 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Securing Huge Downloads using IIS, aspnet_isapi.dl l, HttpHandler...

My company sells software and wants to provide downloadable product. Some of
these downloads will be full CD's of over 550M

I had everything working fine using Response.filewr ite() but when we tested
it with large files, it blew up. (crashed the server, well documented
problem)

I can download a file just fine if I just point to the download file and let
IIS generate the download dialog (but with no security, of course)

In order to add security, I set up IIS to forward the request for a page to
aspnet_isapi.dl l to let it handle security via a authentication ticket.
I can actually get the security part working fine but when the user has
rights to download the file, then asp.net tries to process the file (using
the default HttpHandler, i imagine) and everything crawls to a stop. Ideally
I would like to send the page back to IIS for processing if asp.net security
passes. Is there a way to do this? Can I create an HttpHandler that
basically sends the page back to IIS? If not, what HttpHandler to I use to
bring up the download dialog to the user and then download the file? ...or
do I need to create my own, and what would it look like?

Thanks

Earl

Nov 18 '05 #1
5 2856
asp.net works by iis opening a pipe to the worker process. IIS then sends
the request to the worker process which pipe the response back.

IIS has special code to speed up downloads which you will lose, (and you
will be limited to about 200 downloads at a time), but you want to replace
the PAGE module with one of your own, that just streams out the file (after
checking security). the easiest way is to to build a new vir dir for
downloads.
-- bruce (sqlwork.com)


"Earl Teigrob" <ea******@hotma il.com> wrote in message
news:el******** ******@TK2MSFTN GP12.phx.gbl...
My company sells software and wants to provide downloadable product. Some of these downloads will be full CD's of over 550M

I had everything working fine using Response.filewr ite() but when we tested it with large files, it blew up. (crashed the server, well documented
problem)

I can download a file just fine if I just point to the download file and let IIS generate the download dialog (but with no security, of course)

In order to add security, I set up IIS to forward the request for a page to aspnet_isapi.dl l to let it handle security via a authentication ticket.
I can actually get the security part working fine but when the user has
rights to download the file, then asp.net tries to process the file (using
the default HttpHandler, i imagine) and everything crawls to a stop. Ideally I would like to send the page back to IIS for processing if asp.net security passes. Is there a way to do this? Can I create an HttpHandler that
basically sends the page back to IIS? If not, what HttpHandler to I use to
bring up the download dialog to the user and then download the file? ...or
do I need to create my own, and what would it look like?

Thanks

Earl


Nov 18 '05 #2
If you have a solid budget, FileUPEE is a commercial product that supports
large downloads like that over HTTP. It believe it offloads processing of
the secure files.

www.softartisans.com
"Earl Teigrob" <ea******@hotma il.com> wrote in message
news:el******** ******@TK2MSFTN GP12.phx.gbl...
My company sells software and wants to provide downloadable product. Some
of
these downloads will be full CD's of over 550M

I had everything working fine using Response.filewr ite() but when we
tested
it with large files, it blew up. (crashed the server, well documented
problem)

I can download a file just fine if I just point to the download file and
let
IIS generate the download dialog (but with no security, of course)

In order to add security, I set up IIS to forward the request for a page
to
aspnet_isapi.dl l to let it handle security via a authentication ticket.
I can actually get the security part working fine but when the user has
rights to download the file, then asp.net tries to process the file (using
the default HttpHandler, i imagine) and everything crawls to a stop.
Ideally
I would like to send the page back to IIS for processing if asp.net
security
passes. Is there a way to do this? Can I create an HttpHandler that
basically sends the page back to IIS? If not, what HttpHandler to I use to
bring up the download dialog to the user and then download the file? ...or
do I need to create my own, and what would it look like?

Thanks

Earl



Nov 18 '05 #3
Bruce,

Thanks...thats pretty much what I expected the answer to be. Do you have an
example for an HttpModule that just streams out the file?

Here is what I have so for but I need to know how to take the file input and
stream it to the output...

using System.Web;

namespace Handlers
{
public class DownloadHandler : IHttpHandler
{
public void ProcessRequest( HttpContext context)
{
//Take input and stream to output here...
}

public bool IsReusable{
get {return true;}
}
}
}

Thanks

Earl
"bruce barker" <no***********@ safeco.com> wrote in message
news:e8******** ******@TK2MSFTN GP10.phx.gbl...
asp.net works by iis opening a pipe to the worker process. IIS then sends
the request to the worker process which pipe the response back.

IIS has special code to speed up downloads which you will lose, (and you
will be limited to about 200 downloads at a time), but you want to replace
the PAGE module with one of your own, that just streams out the file (after checking security). the easiest way is to to build a new vir dir for
downloads.
-- bruce (sqlwork.com)


"Earl Teigrob" <ea******@hotma il.com> wrote in message
news:el******** ******@TK2MSFTN GP12.phx.gbl...
My company sells software and wants to provide downloadable product. Some
of
these downloads will be full CD's of over 550M

I had everything working fine using Response.filewr ite() but when we

tested
it with large files, it blew up. (crashed the server, well documented
problem)

I can download a file just fine if I just point to the download file and

let
IIS generate the download dialog (but with no security, of course)

In order to add security, I set up IIS to forward the request for a page

to
aspnet_isapi.dl l to let it handle security via a authentication ticket.
I can actually get the security part working fine but when the user has
rights to download the file, then asp.net tries to process the file

(using the default HttpHandler, i imagine) and everything crawls to a stop.

Ideally
I would like to send the page back to IIS for processing if asp.net

security
passes. Is there a way to do this? Can I create an HttpHandler that
basically sends the page back to IIS? If not, what HttpHandler to I use to bring up the download dialog to the user and then download the file? ....or do I need to create my own, and what would it look like?

Thanks

Earl



Nov 18 '05 #4
Ofter doing more research, I have come to the conclusion that there is not
way to stream large files though .NET without severe memory issues. (I would
love it if someone would prove me wrong but I don't think I am). If you are
up for it, writing a custom IIS ISAPI filter that interacts with a ASP.NET
HttpHandler will work, but requires a lot of knowledge (C++) and time. We
will probably end up buying a third party solution as is mentioned by Ken
Cox in this thread.

New Quote: "Sometimes you just hit the wall"

Earl
"Earl Teigrob" <ea******@hotma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Bruce,

Thanks...thats pretty much what I expected the answer to be. Do you have an example for an HttpModule that just streams out the file?

Here is what I have so for but I need to know how to take the file input and stream it to the output...

using System.Web;

namespace Handlers
{
public class DownloadHandler : IHttpHandler
{
public void ProcessRequest( HttpContext context)
{
//Take input and stream to output here...
}

public bool IsReusable{
get {return true;}
}
}
}

Thanks

Earl
"bruce barker" <no***********@ safeco.com> wrote in message
news:e8******** ******@TK2MSFTN GP10.phx.gbl...
asp.net works by iis opening a pipe to the worker process. IIS then sends
the request to the worker process which pipe the response back.

IIS has special code to speed up downloads which you will lose, (and you
will be limited to about 200 downloads at a time), but you want to replace the PAGE module with one of your own, that just streams out the file (after
checking security). the easiest way is to to build a new vir dir for
downloads.
-- bruce (sqlwork.com)


"Earl Teigrob" <ea******@hotma il.com> wrote in message
news:el******** ******@TK2MSFTN GP12.phx.gbl...
My company sells software and wants to provide downloadable product. Some
of
these downloads will be full CD's of over 550M

I had everything working fine using Response.filewr ite() but when we

tested
it with large files, it blew up. (crashed the server, well documented
problem)

I can download a file just fine if I just point to the download file and let
IIS generate the download dialog (but with no security, of course)

In order to add security, I set up IIS to forward the request for a
page to
aspnet_isapi.dl l to let it handle security via a authentication

ticket. I can actually get the security part working fine but when the user has rights to download the file, then asp.net tries to process the file

(using the default HttpHandler, i imagine) and everything crawls to a stop.

Ideally
I would like to send the page back to IIS for processing if asp.net

security
passes. Is there a way to do this? Can I create an HttpHandler that
basically sends the page back to IIS? If not, what HttpHandler to I
use to bring up the download dialog to the user and then download the file? ...or do I need to create my own, and what would it look like?

Thanks

Earl




Nov 18 '05 #5
Here is what I did to get over memory leaks in large downloads from a database.

Guy
myCommand.Comma ndTimeout = 0
myCommand.Comma ndText = sql
conn.Open()
reader = myCommand.Execu teReader()
While reader.Read()
outputCount += 1
response.Write( reader("record" ) & nl)
'this is required to keep memory from leaking
If outputCount Mod 1000 = 0 Then
response.Flush( )
memsize = GC.GetTotalMemo ry(True)
End If
End While

"Ken Cox [Microsoft MVP]" <BA************ @sympatico.ca> wrote in message news:<uq******* *******@TK2MSFT NGP12.phx.gbl>. ..
If you have a solid budget, FileUPEE is a commercial product that supports
large downloads like that over HTTP. It believe it offloads processing of
the secure files.

www.softartisans.com
"Earl Teigrob" <ea******@hotma il.com> wrote in message
news:el******** ******@TK2MSFTN GP12.phx.gbl...
My company sells software and wants to provide downloadable product. Some
of
these downloads will be full CD's of over 550M

I had everything working fine using Response.filewr ite() but when we
tested
it with large files, it blew up. (crashed the server, well documented
problem)

I can download a file just fine if I just point to the download file and
let
IIS generate the download dialog (but with no security, of course)

In order to add security, I set up IIS to forward the request for a page
to
aspnet_isapi.dl l to let it handle security via a authentication ticket.
I can actually get the security part working fine but when the user has
rights to download the file, then asp.net tries to process the file (using
the default HttpHandler, i imagine) and everything crawls to a stop.
Ideally
I would like to send the page back to IIS for processing if asp.net
security
passes. Is there a way to do this? Can I create an HttpHandler that
basically sends the page back to IIS? If not, what HttpHandler to I use to
bring up the download dialog to the user and then download the file? ...or
do I need to create my own, and what would it look like?

Thanks

Earl


Nov 18 '05 #6

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

Similar topics

0
1135
by: RamseytheScot | last post by:
At the moment we have a httphandler. This handler connects to services and redirect messages to this service. To use this service you have to log on using a Username and Password. This Username and password are saved in the WMI. This by it self is a not very secure thing. Any idear of saving these username and passwords in a more secure fasion, without hard coding them. We are running IIS 5 on Win2000 maybe even Win2003 when we go into...
6
7792
by: Kentamanos | last post by:
Please don't ask me why I'm doing this (trust me, it makes sense in my system), but I'd like to basically redirect requests for a certain extension (thus a handler) to an ASPX page behind the scenes. I've created a handler and set it up to handle the extension in question. In my ProcessRequest, I'd like to basically figure out which ASPX page to "forward" the request to. I've tried all sorts of methods (Server.Transfer and Server.Execute for...
9
1230
by: Johan Pingree | last post by:
HOW in the world is this accomplished! I have an internet site I am prototyping and I need to be able to prevent "casual" browsing of XML documents. Using the web.config forms based authentication does nothing to prevent XML documents from being browsed. We obviously are not interested in turning on digest or basic authentication for this project. Every attempt to use ACL's has resulted in aspx pages having issues in reading and writing to...
3
1132
by: Peter Afonin | last post by:
Hello, I'm using Forms authentication, and it works well. If user is not authenticated, he is routed to the login page. However, this doesn't work for downloads. If I have a file located in the restricted area and put a direct link to it - anyone can download it. Why is this? I expected that people would also be routed to the login screen. How to make this happen?
2
1637
by: Tod Birdsall | last post by:
Hi All, I am trying to secure non-ASP.NET files (i.e. .html, .pdf) in an application running on IIS 6.0, Win2K3 using the .NET Framework 2.0. What has worked in the past using .NET Framework 1.1 on IIS 6.0 is the following : 1. Open IIS 2. Right click website, choose Properties. 3. Click "Home Directory" tab.
2
1287
by: joebickley | last post by:
Hi I have set up forms authentication to secure parts of a site. This works for any requests of .aspx pages but the .doc files etc ignore it altogether. Is there a way i can stop this or an alternative? Were not in an active directory environment so i cant use windows authentication it has to look up via LDAP or a database.
0
1469
by: Burt | last post by:
I have an ASP.NET page that performs a window.open to an HttpHandler that streams a binary file to the brower. I am forcing the save_as... dialog in IE. My issue is that in IE6 the new window opens and the download starts. When the download is cancelled or completed the window automatically closes, which is exactly what I want to happen. The issue is that in IE7 Beta 2 the window just stays open. I've tried using a simple aspx page...
5
1463
by: Dave | last post by:
If I want to process a particular file before being served up in IIS6, is there any alternative to aspnet_isapi.dll? Cheers Dave
7
2818
by: =?Utf-8?B?QU9UWCBTYW4gQW50b25pbw==?= | last post by:
Hi, I have been using the code (some of it has been removed for simplicity) below to allow authenticated (using ASP.NET membership database) users to get a file from their archive area. It seems to work fine, however I noticed that no web log entry is added when a successful download occurs (normally a 200 HTTP status code, however, if there is an authorization failure, it gets logged). I have a logging routine that logs a successful...
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7158
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
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 we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.