473,405 Members | 2,262 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,405 software developers and data experts.

System.Web.StaticFileHandler has a limit?

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?
Oct 24 '06 #1
3 7126
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"
<th********************@discussions.microsoft.comw rote in message
news:80**********************************@microsof t.com...
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?

Oct 24 '06 #2
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"
<th********************@discussions.microsoft.comw rote in message
news:80**********************************@microsof t.com...
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?


Oct 24 '06 #3
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"
<th********************@discussions.microsoft.comw rote in message
news:0D**********************************@microsof t.com...
>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"
<th********************@discussions.microsoft.com wrote in message
news:80**********************************@microso ft.com...
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?



Oct 25 '06 #4

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
6
by: Hannu | last post by:
Hi. In the ldb file you can see the users of the mdb-file. If you open the mdb-file your machine and username will be written in the lbd- file. Allthough you close the mdb-file your name won't...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
2
by: Alper AKCAYOZ | last post by:
Hello, I have developped an application used by Windows Forms (.NET) at Visual C++ ..NET v2003. I would like to limit my application to one instance working at a moment. More than one working...
15
by: jane | last post by:
We are getting this error during a large large load. 2006-06-03-02.58.31.688266 Instance:sieinst Node:000 PID:1286274(db2agent (SRMW) 0) TID:1 Appid:GAFE423C.P4CE.0671B3070116 database...
0
by: digitalcolony | last post by:
My web.config has my site set to UTF-8. <globalization requestEncoding="utf-8" responseEncoding="utf-8" /> This directive is supported with one exception. Any files that go through the...
8
by: =?Utf-8?B?UGlnZ3k=?= | last post by:
Hi to all, I am getting this System.OutOfMemoryException calling the Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(<stream>,<Obj>) method. The type of <streamis...
4
by: Daniel | last post by:
is there some per-process-limit on memory in .net processes? is there any way to increase it? i keep getting System.OutOfMemoryException when my box has 8 gigs of unused memory.
0
by: Pauli | last post by:
Hi all, I am working on Linux (redhat) and I am executing a Perl script. By the help of this script I want to limit the size of the files that the script will create. How can I do it?? P.s:...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.