Full version of multifile Upload system <? Php
// Full version of multifile Upload system
// Powerful function. you can control the number of uploaded files and check whether the files are overwritten.
Include ("../include/common. inc ");
$ Title = "upload programs for multiple files ";
Include ("../include/header. inc ");
// Defines the number of objects that can be uploaded
Define ("UPLOAD_NO", 10 );
Echo ("<p align = 'center'> <font size = '4' color = '#000080'> Welcome! <Br> A maximum of ". UPLOAD_NO." files can be uploaded at a time <br> <HR> n ");
If ($ REQUEST_METHOD! = "POST "){
Echo ("<form enctype =" multipart/form-data "method = post> n ");
Echo ("<input type =" hidden "name =" MAX_FILE_SIZE "value =" 3000000 "> n ");
For ($ I = 1; $ I <= UPLOAD_NO; $ I ++ ){
Echo ("<input type = file name = infile $ I> ");
If ($ I % 2 = 0)
Echo ("<br> n ");
}
Echo ("<br> <input type =" checkbox "name =" overload "value =" ON "> </font> <font color = '# ff0000'> overwrite existing files? </Font> ");
Echo ("<br> <input type = submit value = Upload> </form> n ");
}
Else {
// Process Upload
$ Noinput = true;
For ($ I = 1; $ noinput & ($ I <= UPLOAD_NO); $ I ++ ){
If ($ {"infile". $ I }! = "None") $ noinput = false;
}
If ($ noinput ){
Echo ("<font size = '4' color = '#000080'> if no selected file exists, retry is returned. </font> ");
Exit ();
}
Echo ("<p align = 'center'> <font size = '4' color = '#000080'> The selected file has been successfully uploaded to the temporary directory on the server! </Font> <br> ");
Echo ("<table border = '1' width = '000000' height = '52 'bordercolorlight = '# 84% 'bordercolordark =' #008080 '>
<Tr>
<Td width = '000000' bgcolor = '# 000000' height = '21'> <font color =' # ffff'> File Number </font> </td>
<Td width = '000000' bgcolor = '# 000000' height = '21'> <font color =' # ffff'> file name </font> </td>
<Td width = '000000' bgcolor = '# 000000' height = '21'> <font color =' # ffff'> File size </font> </td>
</Tr> ");
For ($ I = 1; $ I <= UPLOAD_NO; $ I ++ ){
$ Just =$ {"infile". $ I. "_ size "};
$ Fp_size [I] = $ just;
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.