The idea is very simple, because the front-desk upload using the Web Uploader, a Baidu plug-in, the document clearly says there is a multiple attribute, set to True to open the Shard upload, listen to the name on the know can be used to upload large files, I think the breakpoint should be the continuation of such things should be done with this bar. Well, my needs are not so complicated, I can upload them on the line. Then the focus is on the backstage.
Multipart upload background receive, the practice of many online posts is to use Randomaccessfile to get the file, and then the file subscript (do not know how to describe the good) moved to the end of the file, and then the Shard uploaded data written to the back.
Then I met the problem there are two, one met. 1. Multipart upload he is fast sending the data, and Tomcat should be assigning a different thread to each request, so there are multiple threading issues (such as the first request is writing the data before the second request is finished and then the file is written). 2. Multipart upload because it is a request, so the order is not guaranteed, each time the file at the end of the write will appear file corruption. (eg: a file is called "123" and now splits the file into "1", "2", "3".) Three requests are sent to the server, and the server may receive a 321,132 order. This can cause file corruption).