Html5 multipart/multipart upload of ultra-large files

Source: Internet
Author: User
Uploading large files directly on the webpage has always been a headache. This article will introduce the html5 multipart and multipart upload methods for large files, if you are interested, refer to the solution in this article. Direct uploading of large files on webpages has always been a headache. There are two main problems: first, if an error occurs during a long upload period, the previous task will be abandoned; second, the server configuration is complex. You need to consider receiving large forms and timeout issues. If it is a hosted host, you may not be able to change the configuration. By default, you can only receive attachments smaller than 4 MB.

The ideal solution is to split large files and upload them to the server in one piece, and then merge them by the server. The advantage of this is that once the upload fails, only one part is lost, and the whole file is not re-transmitted, and the size of each part can be controlled within 4 MB. The server can adapt without any settings.

The common solution is RIA. Taking flex as an example, the file is usually loaded using the FileReference. load method to get the ByteArray, and then the form is constructed in parts (high versions of flash do not allow direct access to the file ). However, this load method can only load small files, which cannot exceed 300 MB. Therefore, the load method is not very applicable.

Fortunately, now with HTML5, we can directly construct parts. This is a very gratifying improvement, but unfortunately it is not widely used currently (IE, IE, really hate your teeth ).

Let's get down to the point. Let's look at a DEMO, Based on ASP. Net MVC3, which is just an example. Many problems have been simplified.

The main feature is the client. The new features are shown here:

<% @ Page Language = "C #" Inherits = "System. Web. Mvc. ViewPage
  
   
"%>    
       
   Example of multipart upload of HTML5 large files    
   
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.