Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.Web.StaticFileHandler has a limit?

Reply
Thread Tools

System.Web.StaticFileHandler has a limit?

 
 
=?Utf-8?B?dGhlIGZyaWVuZGx5IGRpc3BsYXkgbmFtZQ==?=
Guest
Posts: n/a
 
      10-24-2006
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?
 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      10-24-2006
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"
<(E-Mail Removed) m> wrote in message
news:(E-Mail Removed)...
> 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?



 
Reply With Quote
 
 
 
 
=?Utf-8?B?dGhlIGZyaWVuZGx5IGRpc3BsYXkgbmFtZQ==?=
Guest
Posts: n/a
 
      10-24-2006
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

"Karl Seguin [MVP]" wrote:

> 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"
> <(E-Mail Removed) m> wrote in message
> news:(E-Mail Removed)...
> > 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?

>
>
>

 
Reply With Quote
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      10-25-2006
Sorry almost lost this thread...

It only uses TransmitFile if the file is larger than 400 megs. That's why
I'm suggesting you write your own to ALWAYS use TransmitFile - frankly,
that's how StaticFileHandler should be done..

Karl

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


"the friendly display name"
<(E-Mail Removed) m> wrote in message
news:(E-Mail Removed)...
>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
>
> "Karl Seguin [MVP]" wrote:
>
>> 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"
>> <(E-Mail Removed) m> wrote in message
>> news:(E-Mail Removed)...
>> > 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?

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some shareware has a time limit and the software will not work after the time limit has expired. anthony crowder Computer Support 20 01-16-2007 10:01 AM
When a control on form has blank value or has no items (dropdownlist) then it wont' be in Request.Forms TS ASP .Net 3 10-06-2006 01:29 PM
The printing has been stopped and this job has been add to the queu? dejola Computer Support 6 12-30-2005 03:26 AM
Downloaded document has disappeared by the time Word has opened Rob Nicholson ASP .Net 12 12-06-2005 04:59 PM
ZoneAlarm has detected a problem with your installation, and therefore has restricted Internet access from your machine for your protection. Donít panic A Teuchter Computer Support 2 05-19-2005 09:20 PM



Advertisments