Struts1.x Series Tutorials (9): Upload any number of files

Source: Internet
Author: User

From the examples given in the struts1.x series Tutorial (8): Uploading a single file, you can see that Uploading a single file in struts1.x is very simple, but in practical applications, the number of uploaded files is generally uncertain, such as in the network hard disk, users can upload any number of files according to their own needs (of course, the number of network hard disk upload files are generally capped, such as 50, but users can upload only 3 files, so , in this case, the number of uploaded files is also uncertain. If the reader has used the "NetEase network Disk" or other similar service programs, their upload file function is basically based on the user selected files to add the file to upload (not at the beginning of the interface put a lot of <input type= ' file ' > elements to allow users to enter the upload file name). In order for readers to use struts to achieve this feature, in this section, a Web program that uploads as many files as a "NetEase network disk" with struts is presented. Before implementing the Web program, let's take a look at the main page shown in Figure 1.

Figure 1

In this program, by entering a local file name in the text box or using the Browse button to select the file to upload, the user adds the file name to the bottom of the interface, and if the entry is incorrect or does not want to upload a file, you can delete the current file using the Delete feature. After confirming the correct entry of all uploaded files, use the "Upload" button to start uploading files.

The basic steps for implementing this Web program are similar to those given in the Struts1.x series Tutorial (8): Uploading a single file, and we can implement this web program by following five steps:

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.