Multifile Upload example _ PHP Tutorial

Source: Internet
Author: User
Multifile Upload example. Multifile Upload example: upload_html.php --------------------------------------------------------------------------------------------- HTMLHEADTITLE Upload file TITLEHEADscrip multifile Upload example // upload_html.php example ---------------------------------------------------------------------------------------------


Upload files

Script
Function beforesubmit (forma)
{
Var indexnamea = forma. indexname. value;
Var upfilea = forma. upfile. value;
Var k = // g;
Var indexnamea = indexnamea. replace (k ,"");
Var upfilea = upfilea. replace (k ,"");
If (indexnamea = ""
Upfilea = "")
{
Alert ("The directory name or uploaded directory cannot be blank! ");
Return false;
}
Return true;
}
Script





// Configure //-----------------------------------------------------------------------------------------------------------------------

// Upload. php plugin -------------------------------------------------------------------------------------------------------------
// Upload_path: directory to which the file is to be uploaded
For ($ I = 1; $ I <8; $ I ++)
{
$ Upfile = "upfile". strval ($ I );
If (chop ($ indexname )! = "" And chop ($ upfile )! = "")
{
$ Upfilename = ($ upfile. "_ name ");
$ Filename = upload_path. $ upfilename;
$ Copyfile = copy ($ upfile, $ filename );
If (! $ Copyfile)
Die ("file Upload failed! ");
$ Ls_file. = $ upfilename. "\ n ";
$ Flag = 1;
}
}
If ($ flag ){
$ Ls_msg = "file \ n". $ ls_file. "uploaded successfully! ";
}
Else {
$ Ls_msg = "no file is uploaded. please reselect it! ";
}
Echo"\ N ";
Echo"\ N ";
Echo"\ N ";
Echo"\ N ";
Echo $ ls_msg. "\ n ";
Echo"\ N ";
Echo"\ N ";
?>

Upload your html head title to upload a file/TITLE/HEAD scrip...

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.