System.Web.StaticFileHandler has a limit?

G

Guest

Hi

I tried to secure non .aspx files from unauthorized downloading with the
common method: Assign the file extension of the to be secured files in IIS to
aspnet_isapi.dll and map the extension in the web.config file to the
System.Web.StaticFileHandler.

It works, with the exception of one big problem:

Bigger files can't be downloaded. If I try to download secured files that
are below 30 mb, it works fine, but around 30 or more, i get an 404.
It seems that System.Web.StaticFileHandler has a limit. How can I circumvent
it?
 
K

Karl Seguin [MVP]

From a previous post by David Wang of Microsoft:

"The problem with the proposed solution is that static files are now handled
by ASP.Net StaticFileHandler instead of IIS StaticFileHandler.

IIS StaticFileHandler is about as optimized as it gets - full support of
HTTP.SYS kernel mode response caching, built in file response caching, and
pure native code with no managed code interop.

ASP.Net StaticFileHandler had problems with large file sizes, memory
buffer/usage, kernel mode response caching, and introduces managed code
interop. Its history is non-optimal."

In 2.0, there's a new method to the Response object named TransmitFile. The
StaticFileHandler automatically uses it for files larger than 400 megs.

There's a hotfix for this method for 1.x that you can download at:
http://support.microsoft.com/kb/823409/EN-US/

if you ARE using 2.0...the only think I can think of is that you write your
own handler which ALWAYS uses TransmitFile....

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"the friendly display name"
 
G

Guest

I am using .net 2.0 (partially)

If staticfilehandler in 2.0 automaticaly calls transmitfile.. why doesn't it
do it with my app? Is it bug? Any idea?

btw. i am using .net 2.0 on the server, but I compiled the app on .net 1.1
(VS 2003). But, that shouldn't be a problem, because the jitting happens on
2.0 (server machine: windows 2003, iis6, net 2.0)

Thanks for the answer
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top