JS WEB how to achieve a large file uploads

It is well known, web upload large files, has been a pain. Upload file size limit, page response times out. These are the web developers must face.

Solution given herein is: a front end to achieve a long pass sliced ​​data stream, the idea behind After acceptance merge file.

Implement folder upload requirements: server hierarchy retained, 10w support level folder upload.

Large file uploads and HTTP request: support a single file upload and 50G-level resume. Resume requirements: the ability to resume upload after refreshing your browser, and continuing to upload on after the restart the browser (reopen after closing the browser), can continue to upload after restarting the computer.

Full platform support for PC side, Windows, Mac, Linux

Browser Requirements support all browsers, including ie6, ie7, ie8, ie9, Chrome, Firefox

 

Easy DEMO source code posted below Share:

Front page:

 

Back-end code, this Demo is based on the MVC architecture:

I had a back-end code module of the plan, rather than all of the modules in one class, so for future maintenance and upgrades for both a disaster online.

 

File processing logic block

 

Save the file block logic is as follows

 

web.xml configured as follows

 

The entire project screenshot

 

As the dependent JAR

 

Operating results are as follows:

 

Here to share! ~ Hope a lot of correction

Most of the back-end code logic is the same, currently supports MySQL, Oracle, SQL. Before using the need to configure the database, you can refer me to write this article: http://blog.ncmem.com/wordpress/2019/08/07/java upload and download large files /


Guess you like

Origin www.cnblogs.com/songsu/p/12155595.html