Multiple file upload in php

前端 未结 14 1617
轮回少年
轮回少年 2020-11-21 11:32

I want to upload multiple files and store them in a folder and get the path and store it in the database... Any good example you looked for doing multiple file upload...

14条回答
  •  伪装坚强ぢ
    2020-11-21 12:05

    
    
    
    
    Untitled Document
    
    
    
    ";
    echo "";
    for($i=1; $i<=$max_no_img; $i++){
    echo "";
    }
    
    echo "";
    echo "
    Images $i
    "; while(list($key,$value) = each($_FILES['images']['name'])) { //echo $key; //echo "
    "; //echo $value; //echo "
    "; if(!empty($value)){ // this will check if any blank field is entered $filename =rand(1,100000).$value; // filename stores the value $filename=str_replace(" ","_",$filename);// Add _ inplace of blank space in file name, you can remove this line $add = "upload/$filename"; // upload directory path is set //echo $_FILES['images']['type'][$key]; // uncomment this line if you want to display the file type //echo "
    "; // Display a line break copy($_FILES['images']['tmp_name'][$key], $add); echo $add; // upload the file to the server chmod("$add",0777); // set permission to the file. } } ?>

提交回复
热议问题