Usually the upload of pictures, not a two, we need to upload a lot, and can not upload too much, can not upload a piece of it, so much trouble
In view of this, using JS to do a multiple file upload demo, combined with ASP, do not joke I still use such a cliché language, I am also trying to use the rest of the time to learn, hehe
Requirements:
1. You can add and remove file Form controls
2. Verify validity when uploading
3. Make file format judgment
4. Server rename and save multiple uploaded files
5. Limit the maximum number of files uploaded at one time
See Demo:
To illustrate, I am here with the old farmer's transformation without components, slightly changed a bit
Added a public function makefilename (EXT), the return value is a random file name generated from the extension
Format: Date (8-bit) + time (6-bit) + random number (3-bit), such as: 20080904104412999.jpg
Mainly in order to avoid uploading multiple files at a time when the duplicate name, but also to avoid the server with the duplicate file name
Made a simple GIF format demo, add more than 10 files, will pop-up prompts!
This article supporting source code