File Upload and Download Limits
Over the last few years, we’ve had a few questions about WinINET’s limits for file upload and download. I’ve summarized those limits in the following table:
|
Upload (total size) |
Download (per file) |
Internet Explorer 6 |
2gb | 2gb (4gb for Chunked or Connection-Close transfers) |
Internet Explorer 7 |
2gb | 4gb |
Internet Explorer 8 |
2gb | 17,592GB |
Internet Explorer 9 to 11 |
4gb | 17,592GB |
- In Internet Explorer 8, we raised the maximum file size that can be downloaded from 4GB to the 17TB, the maximum file size storable in the NTFS file system. In practice, most NTFS volumes are limited to 2TB, and you of course will almost certainly run out of disk space (or download quota) long before reaching that mark.
- In Internet Explorer 9, we fixed an integer wraparound bug in the file upload code. Prior to the fix, file uploads between 2gb and 4gb would send a negative value in the Content-Length header.
Large File Uploads
You may notice that even IE11 is limited to 4gb uploads, but that's not a significant problem because websites should never try to upload large files (e.g. >50mb) directly in modern browsers.
Instead, utilizing the HTML5 FileAPI supported in IE10+ (and all other major browsers), the file should be sliced into pieces that are individually uploaded using JavaScript. The advantage to this approach (beyond allowing uploads of any size) is that it enables rich progress notifications to the user and resumption of incomplete uploads. This is the approach used by video upload sites like YouTube, for instance.
If you're not ready to move to the slicing approach, you can still use the FileAPI to warn the user if they attempt to upload a file that is over 4gb in size:
<script>
function checkSize(inputControl)
{
if (typeof FileReader !== "undefined") {
var cbSize = inputControl.files[0].size;
if (cbSize > Math.pow(2,32)) alert("File too large for normal upload; it's " +cbSize + "bytes.");
}
}
</script>
<form action="FileForm.asp" method="POST" enctype="multipart/form-data">
<input id="fileentry" type="file" name="fileentry" size="35" onchange="checkSize(fileentry);">
<input id="inpChar" type=hidden name="_charset_">
<input id="inpSub" type="submit" value="Submit using multipart/mixed">
</form>
You may wish to do this because otherwise a silent submit failure occurs.
-Eric
Comments
Anonymous
March 14, 2011
So, have you guys set up a machine to test uploading a 17 TB file? I've heard some neat stories about testing the limits of MS software (number of processors, max memory, etc), but this might be the most interesting :)Anonymous
March 15, 2011
Nick: Uploading a 17TB file won't work. For downloading giant files, you can use Meddler (www.fiddler2.com/meddler), a script for which can dynamically generate and return a "file" of any size you like.Anonymous
March 16, 2011
The funny thing is that increasing max file size from 2GB to 4GB was probably trivial.Anonymous
March 16, 2011
@Yuhong: Yes, the IE9 change was actually only a one-liner. The code to raise the download limit in IE7, in comparison, was a much larger change because there were many more bottlenecks that needed adjustment.Anonymous
July 18, 2011
How can I get the file's size BEFORE uploading? I'm trying to keep the file size under a maximum size, but IE 9 doesn't provide this information. (duplicate of my last post since I wasn't signed in)Anonymous
July 18, 2011
The comment has been removedAnonymous
July 10, 2012
Eric, Is there a way to skip Content-Lenght check, streamline the upload? Can method="put" in a HTML form make it? Does IE8 or IE9 support method="put'? Thanks.Anonymous
July 10, 2012
@Helen: HTTP permits "streaming" of uploads using Transfer-Encoding: chunked. IE doesn't use this, and many servers won't support it. HTML offers no way to do a PUT upload using a Web Form, although XMLHTTPRequest can make PUT requests.Anonymous
October 30, 2012
Hi Eric, Your post is very informative. We are using different versions of IE browsers and tested the upload file size limit from 2gb to 4gb. IE9 is not responding after 2.5gb file size upload action. Is there any debug available for this ?Anonymous
December 13, 2012
So, what is prohibiting IE 9 and 10 from uploading greater than 4GB files? Is this limited to the 32bit version? Why can Google Chrome allow larger than 4GB uploads in Windows 7 than IE 9 or 10 can? EricLaw: IE's upload limit derives from the fact that a 32bit integer is used for progress tracking. This is the same across both 32bit and 64bit versions. If Chrome can upload larger files, that suggests that it is not using a 32bit integer. One important thing to keep in mind is that a HTML5 site is very unlikely to attempt to do a file upload using an HTML form; instead, an XmlHTTPRequest object will send chunks of the file. This allows a file of arbitrary size to be uploaded and provides more options for retry/error-recovery.Anonymous
January 30, 2015
Do you have a link to the Internet Explorer 9 integer wraparound bug fix you mentioned please? [EricLaw] I'm not sure what you mean? The bug was fixed during IE9 development, if that's what you're asking.Anonymous
February 22, 2019
A quick test shows that trying to directly upload files in Microsoft Edge (on Win10 RS5) over 4gb using an input type=file fails immediately (e.g. the form doesn’t even try to navigate/submit). Even uploading files that are just under the 4gb limit can fail (crashing the browser tab) due to an out-of-memory error. This limit no longer exists in the upcoming next-generation Microsoft Edge based on Chromium.