IEInternals

A look at Internet Explorer from the inside out. @EricLaw left Microsoft in 2012, but was named an IE MVP in '13 & an IE userAgent (http://useragents.ie) in '14

File Upload and Download Limits

File Upload and Download Limits

  • Comments 10

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

  • 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 :)

  • 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.

  • The funny thing is that increasing max file size from 2GB to 4GB was probably trivial.

  • @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.

  • 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)

  • @Silkster: No such mechanism exists today in script in IE9; you can use Flash or Silverlight for this. Alternatively, your server could immediately abort the upload if the Content-Length on the request exceeds your desired maximum.

  • 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.

  • @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.

  • 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 ?

  • 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.

Page 1 of 1 (10 items)
Leave a Comment
  • Please add 1 and 1 and type the answer here:
  • Post