Full version of multifile Upload system

Source: Internet
Author: User
? Php multi file upload system Full version function is powerful, can control the number of uploaded files, whether to overwrite the Mail: pjzhp@263.netinclude (.. includecommon. inc); $ title Upload program for multiple files; include (.. includeheader. inc); define the number of files that can be uploaded define (UPLOAD_NO, 10 ); // Full version of multifile Upload system
// Powerful function. you can control the number of uploaded files and check whether the files are overwritten.
// Nagging
// Mailbox: Pjzhp@263.net
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 ("



































");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 (" ");}}}Else {if ($ {"infile". $ I }! = "None "&? ($ {"Infile ". $ I}, AddSlashes (dirname ($ PATH_TRANSLATED )). "upload ". $ {"infile ". $ I. "_ name"}) & unlink ($ {"infile ". $ I })){$ Str =$ {"infile". $ I. "_ name "};Echo (" ");}}}Echo"
File number File name File size
$ I $ Str $ Fp_size [I]
$ I $ Str $ Fp_size [I]
";
}
Include ("../include/footer. inc ");
?>

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.