multi image upload wrong quantity on file-upload

后端 未结 4 2101
野趣味
野趣味 2020-12-12 07:20

i like to upload some images to a directory with the help of arrays. therefore i have this code:

$allowedExtensions = array(\'jpg\', \'jpeg\', \'png\', \'bmp         


        
4条回答
  •  Happy的楠姐
    2020-12-12 07:47

    I'm not sure if this may solve it for you, but you can try to convert these into "normal" $_FILES values.

    $arr_files  =   @$_FILES['image'];
    
    $_FILES     =   array();
    foreach(array_keys($arr_files['name']) as $h)
    $_FILES["image_{$h}"]    =   array(  'name'      =>  $arr_files['name'][$h],
                                        'type'      =>  $arr_files['type'][$h],
                                        'tmp_name'  =>  $arr_files['tmp_name'][$h],
                                        'error'     =>  $arr_files['error'][$h],
                                        'size'      =>  $arr_files['size'][$h]);
    

    And then run the loop like normal.

    See previous related answer

提交回复
热议问题