PHP instance: use PHP to implement multi-file upload system programs

Source: Internet
Author: User
PHP instance: use PHP to implement the multi-file upload system program // define the number of files to be uploaded // The full version of the multi-file upload system // failed to process the upload copy

PHP instance: use PHP to implement multi-file upload system programs

// Full version of multifile Upload system
Include ('../include/common. inc ');
$ Title = 'upload programs for multiple Files ';
Include ('../include/header. inc ');

// Define the number of objects to 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 ($ {'file'. $ 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 =$ {'file'. $ I. '_ size '};
$ Fp_size [I] = $ just;

If ($ overload! = ON ){
If (file_exists (AddSlashes (dirname ($ PATH_TRANSLATED). '\ upload \'. $ {'file'. $ I. '_ name '}))
Echo 'file you uploaded '. $ {'infile'. $ I.' _ name'}. 'already exists. An error occurred while copying the file!
';
Else {
If ($ {'file'. $ I }! = 'None '&©($ {'File '. $ I}, AddSlashes (dirname ($ PATH_TRANSLATED )). '/upload /'. $ {'file '. $ I. '_ name'}) & unlink ($ {'infile '. $ I })){
$ Str =$ {'file'. $ I. '_ name '};
Echo ('











$ Str =$ {'file'. $ I. '_ name '};
Echo ('








}
Echo'

      ');       ');}}}Else {If ($ {'file'. $ I }! = 'None '&©($ {'File '. $ I}, AddSlashes (dirname ($ PATH_TRANSLATED )). 'upload '. $ {'file '. $ I. '_ name'}) & unlink ($ {'infile '. $ I })){       ');}}
File numberFile nameFile 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.