Google Is Our Friend (And How to get past the 4 megabyte, and then the 30 megabyte, upload limit on Microsoft Web Servers)
May
24
Written by:
5/24/2011 2:29 PM

Today we spent a couple hours tracking down an issue for one of our long time clients. We built them an application about a year ago that enabled them to upload large files to their website, organize them into virtual folders, and share them with vendors, clients, and internal staff. Instead of paying next to nothing up front and then getting eaten up with monthly service charges, they paid for the application itself, put it on their own server, and they're now home free... of course, until little hiccups like this come up.
Thanks to our understanding of "how to talk to Google," we were able to dive into this issue and find the culprit. It was buried in the midst of several other "minor" issues that, put together, made us one complete headache. We wound up piecing together a solution from everything we found, and logged it all on a forum site built by the vendor who created a piece of the puzzle we put together for our client. I'm writing about it here because I need to remind myself that much of the consulting work we do is not simply "having all the answers." It's much more about knowing where to find them. Knowing how to talk to Google. Knowing how to take everything you can find on the web - forums, support tools, blogs, manuals - mash them all together, weed out the junk, and come out with just the right solution that's not overkill, sloppy code, or an incomplete solution. That's one of the big pieces of value we bring to the table, and it's
worth something.
If you're here to learn about us and how we work, you can probably stop right here. Because the rest of this is copied from the vendor's site detailing the solution we found to our problem; maybe it will help someone else find THEIR way at a later date.
This was originally posted by me at
telerik.com.
-
Chet
Posted
43 minutes ago
(permalink)
Hi. I have a client that I've developed a solution for using RadUpload. We've discovered just recently that there seems to be a barrier somewhere around 30 megabytes. I flipped over to another solution I have that uses RadUpload (different server) and am experiencing the same thing. Both servers are Server 2008, and I've modified the web.config file on both servers as follows:
So both servers are configured for a maximum 100MB file and 60 minutes of upload.
I have tested files of various size between 1MB and 28MB and they upload fine - everything, including my ProgressArea, works. When i upload a file above 30 MB, though, my ProgressArea doesn't display, and after about 2 minutes (regardless of connection speed), I get redirected to a 404 or timeout page.
I've tested this on everything from a 512kb (up) connection to a 7mb (up) connection and the barrier seems to be right around 30 megabytes, consistently.
I am running these inside UpdatePanels using AJAX but have added a PostBackTrigger to my upload button to trigger a full page postback when it is clicked.
Hopefully that's enough info to get some help here. I've seen several people with issues related to the web.config settings and the ajax postback settings, but I think I have both of those dealt with. I'd appreciate your assistance.
Thanks,
Chet
-
Chet
Posted
33 minutes ago
(permalink)
It's always the "one last search" after you post that gets you... I'm trying this out now:
http://www.cyprich.com/2008/06/19/fixing-file-upload-size-limit-in-iis-7/
-----
Adjusting File Size Limit in IIS 7
The problem is that in IIS 7 on Windows 2008 Server, the web application will reject any file that is larger than 30 MB. This is a default limitation of IIS. You can increase the maximum file size by adding the following code to <system.webServer> in the web.config file:
With the above maxAllowedContentLength, users can upload files that
are 2,000,000,000 bytes in size. This setting will work right away
without restart IIS services.
-----
I did this, changing the maximum length to 102400000 to allow for a 100 meg upload:
Perfectamundo! I am now uploading a 36 meg file and will try something right under 100 megs after that, and then right OVER 100 megs after that to prove to myself that I've truly found the solution to my issue.
Chet
-
Chet
Posted
19 minutes ago
(permalink)
Success! I can now upload 36 meg files and 97 meg files but not 103 meg files. Exactly what I wanted to happen.
So to make RadUpload work with files over 30 megs in Server 2008 and IIS 7, I had to change web.config in two places: first, in <httpRuntime> and second, in <system.webServer> under <requestLimits...> .
Hopefully this helps someone else down the road...
-
Chet
Posted
14 minutes ago
(permalink)
Oh, and just another little FYI... if you're uploading these files and then storing them in a database... and trying to play with files right at the 100 meg limit... you may need to check the maximum size of your tempdb database... mine was set at... you guessed it... 100 megs. Another little hiccup solved.