Today I did a little research on the multi-image upload function, and sorted out the following code to facilitate my own use in the future and for everyone to communicate
1. Upload.html page, that is, the file with input type=file:
Copy code The code is as follows:
< ;title>
2. do_upload.php page, which is the page that handles multiple file uploads :
Copy code The code is as follows:
//Global array $_FILES
//$_FILES[ 'userfile']['tmp_name']The location where the file is temporarily stored in the web server
//$_FILES['userfile']['name']The file name in the user system
//$_FILES[' userfile']['size']The byte size of the file
//$_FILES['userfile']['type']The MIME type of the file, text/plain, image/gif
//$_FILES[ 'userfile']['error'] Error code related to file upload
?>
//Use a for loop to get the passed data, which is a three-dimensional data
for ($i=0;$i{
$upfile=$new_folder."/".$_FILES[' userfile']['name'][$i];//You can modify this according to your own needs
if(move_uploaded_file($_FILES['userfile']['tmp_name'][$i],$upfile) ){
echo "No.".($i+1)."Picture uploaded successfully
";
}
else{
echo "No.".($i+1 )."Unable to upload picture
";
}
}
?>
http://www.bkjia.com/PHPjc/326834.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326834.htmlTechArticleToday I did a little research on the multi-image upload function and sorted out the following code to facilitate my own use in the future. And for everyone to communicate 1. upload.html page, that is, input type=f...