ASP multi-File Upload

Source: Internet
Author: User

Generally, the upload of images is not one or two. We need to upload images in batches. We cannot upload too many images at a time. We cannot upload images at a time.
In view of this, I used JS as a multi-File Upload demo. Combined with ASP, I am still using such an old language. I am also trying to learn it with the rest of the time.

Requirements:
1. You can add or delete file form controls.
2. Verify validity during upload
3. Determine the file format
4. The server renames and saves the uploaded files.
5. Limit the maximum number of files uploaded at a time

Demo:

Note: I used the chemical environment of the old rice farmers without components. I made a slight change.
Added a public function makefilename (EXT). The returned value is a random file name generated based on the extension.
Format: Date (8 bits) + time (6 bits) + random number (3 bits), for example, 20080901164412999.jpg

This is mainly to avoid duplicate names when uploading multiple files at a time, and to avoid duplicate names with existing files on the server.

A simple GIF format demonstration is provided. A prompt is displayed when more than 10 files are added! A txt document was uploaded intentionally, and the verification failed.
You can see the uploaded document in the upload folder.

Code: multifileupload.rar

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.