473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Securing Huge Downloads using IIS, aspnet_isapi.dll, 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.filewrite() 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.dll 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 2841
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******@hotmail.com> wrote in message
news:el**************@TK2MSFTNGP12.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.filewrite() 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.dll 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******@hotmail.com> wrote in message
news:el**************@TK2MSFTNGP12.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.filewrite() 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.dll 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**************@TK2MSFTNGP10.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******@hotmail.com> wrote in message
news:el**************@TK2MSFTNGP12.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.filewrite() 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.dll 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******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.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**************@TK2MSFTNGP10.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******@hotmail.com> wrote in message
news:el**************@TK2MSFTNGP12.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.filewrite() 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.dll 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.CommandTimeout = 0
myCommand.CommandText = sql
conn.Open()
reader = myCommand.ExecuteReader()
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.GetTotalMemory(True)
End If
End While

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message news:<uq**************@TK2MSFTNGP12.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******@hotmail.com> wrote in message
news:el**************@TK2MSFTNGP12.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.filewrite() 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.dll 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
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...
6
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....
9
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...
3
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...
2
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...
2
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...
0
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...
5
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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,...
0
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...

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.