? Php multi-file upload system Full version include (.. includecommon. inc); $ title Upload program for multiple files; include (.. includeheader. inc); define the number of files that can be uploaded define (UPLOAD_NO, 10); echo (paligncenterfontsize4color #000080 welcome! Up to one br // Full version of multifile Upload system
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 ("
Welcome!
You can upload up to ". UPLOAD_NO." files at a time.
N ");
If ($ REQUEST_METHOD! = "POST "){
Echo ("n ");
}
Else {
// Process Upload
$ Noinput = true;
For ($ I = 1; $ noinput & ($ I <= UPLOAD_NO); $ I ){
If ($ {"infile". $ I }! = "None") $ noinput = false;
}
If ($ noinput ){
Echo ("no selected file, return retry ");
Exit ();
}
Echo ("
The selected file has been successfully uploaded to the temporary directory on the server!
");
Echo ("
File number |
File name |
File size |
");For ($ I = 1; $ I <= UPLOAD_NO; $ I ){$ Just =$ {"infile". $ I. "_ size "};$ Fp_size [I] = $ just;If ($ overload! = ON ){If (file_exists (AddSlashes (dirname ($ PATH_TRANSLATED). "\ upload \". $ {"infile". $ I. "_ name "}))Echo "the file you uploaded". $ {"infile". $ I. "_ name"}. "already exists. An error occurred while copying the file!";Else {If ($ {"infile". $ I }! = "None "&©($ {"Infile ". $ I}, AddSlashes (dirname ($ PATH_TRANSLATED )). "/upload /". $ {"infile ". $ I. "_ name"}) & unlink ($ {"infile ". $ I })){$ Str =$ {"infile". $ I. "_ name "};Echo ("
$ I |
$ Str |
$ Fp_size [I] |
");}}}Else {If ($ {"infile". $ I }! = "None "&©($ {"Infile ". $ I}, AddSlashes (dirname ($ PATH_TRANSLATED )). "upload ". $ {"infile ". $ I. "_ name"}) & unlink ($ {"infile ". $ I })){$ Str =$ {"infile". $ I. "_ name "};Echo ("
$ I |
$ Str |
$ Fp_size [I] |
");}}}Echo"
";
}
Include ("../include/footer. inc ");
?>