How do I configure IIS to handle really large file uploads?
Asked Answered
Y

7

9

Platform: IIS 6, ASP.Net 2.0 (.Net 3.5), Server 2003.

I'm building an application that accepts files from a user, processes them, and returns a result. The file is uploaded using HTTP POST to an ASP.Net web form. The application is expecting some large files (hundreds of MB).

I'm using SWFUpload to accomplish the upload with a nice progress bar, but that's not contributing to the issue, because when I bypass it using a standard HTML form pointing at my upload accepter page, I get the exact same error. When using the progress bar, the upload continues to 100%, then fails. With a standard form, the behavior appears to be the same.

I'm having a problem right now uploading a file that's about 150MB. I've changed every settings I can find, but still no luck.

Here's a summary of what I've changed so far:

In Web.config: Added this inside system.web:

<httpRuntime executionTimeout="3600" maxRequestLength="1536000"/>

In machine.config: Inside system.web, changed:

<processModel autoConfig="true" />

to:

<processModel autoConfig="true" responseDeadlockInterval="00:30:00" responseRestartDeadlockInterval="00:30:00" />

and in MetaBase.xml: Changed:

AspMaxRequestEntityAllowed="204800"

to:

AspMaxRequestEntityAllowed="200000000"

When the upload fails, I get a 404 error from IIS. My web form does not begin processing, or at least, it doesn't make it to the Page_Load event. I threw an exception at the beginning of that handler, and it doesn't execute at all on large files.

Everything works fine with smaller files (I've tested up to about 5.5MB). I'm not exactly sure what file size is the limit, but I know that my limit needs to be higher than 150MB, since this is not the largest file that the client will need to upload.

Can anyone help?

Yousuf answered 15/10, 2008 at 19:42 Comment(0)
Y
6

Urlscan was active on all websites, and has it's own request entity length limit. I wasn't aware that Urlscan was running on our server because it was a global ISAPI filter, not running on my individual website.

Note: to locate global ISAPI filters, right click on the Web Sites folder in IIS Admin and click Properties, then on the ISAPI Filters tab.

Yousuf answered 15/10, 2008 at 22:39 Comment(0)
F
3

(A note for googlers):

For IIS7 add below to web.config (I added above <system.serviceModel>):

<system.webServer>
        <security>
            <requestFiltering><requestLimits maxAllowedContentLength="262144000" /></requestFiltering> <!-- maxAllowedContentLength is in bytes. Defaults to 30,000,000 -->
        </security>
</system.webServer>
Favor answered 19/12, 2011 at 21:48 Comment(0)
C
2

When we ran into this issue we had to increase the buffer size limit according to this KB article: http://support.microsoft.com/kb/944886/en-us

I know this mentions ASP, but I believe it worked for ASP.NET as well.

Edit: Here is a link that might be more relevant to your issue and provide other options:
http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx

Canvasback answered 15/10, 2008 at 19:46 Comment(2)
The first article is related to downloads, not uploads, but I tried it anyway, with no success. The Jon Galloway article covers the things I mentioned above.Yousuf
Yeah I re-read your question and realized my first link was incorrect, but I felt odd about just taking it all out. So I looked into it a little further and posted the second link as an edit. I hope the second link helped.Canvasback
Z
1

404 and missing Page_Load: IIS can only process the request once the complete POST is on the server. Therefore, if the POST fails (due to its size), it cannot fire the page's events.

You might try NeatUpload http://www.brettle.com/neatupload. From the Manual: "By default, NeatUpload does not directly limit the size of uploads."

Zofiazoha answered 15/10, 2008 at 20:0 Comment(0)
H
0

You can also try Velodoc XP Edition which has several advantages over NeatUpload including the fact that it uses ASP.NET Ajax extensions. See also the Velodoc web site for more information.

Hydroponics answered 27/11, 2008 at 13:47 Comment(0)
P
0

You say:

But 1536000 is only 1.5MB?

Pasol answered 28/7, 2009 at 4:32 Comment(1)
That size is in kilobytes, so it's actually ~1.5GB.Kahaleel
M
0

A bit off topic, but this may help someone! After fixing up my web config, I was still not able to upload large files. Turns out that the site was being proxied by Cloudflare who block files > 100MB. Totally didn't think about until I had lost 90% of my hair! Turned off the proxy option, and viola, files flowing like magic again...

enter image description here

Maestricht answered 3/5 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.