Front-end large file upload source

We usually always do is upload files, folders and upload files to upload similar, but there are some differences, this did upload folder on the record for future use after the next.

First, we need to understand is uploaded three elements:

1. The form submission: post (get submission is limited in size, post no)

2. Form enctype attribute: must be set to multipart / form-data.

3. The form must have file upload item: file, and the file entry need given name value

Upload folder need to add a property webkitdirectory, like this:

<input id="fileFolder" name="fileFolder" type="file"  webkitdirectory>

js can determine the number of folders and files in the folder size meets the requirements, do not meet the requirements can not be submitted to the background:

Front HTML template

Select the file, select the folder, and paste logical files and folders

 

Upon receiving the folder background is different in need MultipartHttpServletRequest

 

server-side packages and classes

 

 

Processing logic f_post.jsp page

 

 

Logic generates a file name

 

 

The following is a treatment service layer to do:

Integral module divided as follows:

Wherein the following logical processing entity data class

Back-end database basically uses a logical entity classes above

File data table class of operation is as follows

To achieve the following overall effect after

Upload folder after effects

Save the server folder data, and the local hierarchy and the client is the same. This OA system or network disk system is very useful when using

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/12/java-http%E5%A4%A7%E6%96%87 % E4% BB% B6% E6 % 96% AD% E7% 82% B9% E7% BB% AD% E4% BC% A0% E4% B8% 8A% E4% BC% A0 /

Welcome to the group to discuss: 374 992 201

Guess you like

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