HTML page:
1 <Divclass= "Form-group thumb">2 <labelclass= "Control-label col-xs-12 col-sm-3 no-padding-right" for= "Info">Product image upload:</label>3 4 <Divclass= "Col-xs-12 col-sm-9"style= "width:25%;">5 6 <Divclass= "Clearfix"><inputtype= "File"multiple= "true"name= "images[]"ID= "Id-input-file-2" /></Div>7 8 </Div>9 </Div>
Multiple= "true" name= "images[]"
These two are more important, that is, otherwise: 1, can not select more files. 2, upload the file $_files only one file.
Print out file type after uploading:
In this format, we must not be able to use thinkphp upload and Uploadone method to upload files.
1 Array2 (31=>Array(4([name]=>5[type]=>6([name]=>7[type]=>8([name]=>9[type]=>Ten ) One2=>Array( A([name]=> -[type]=> -([name]=> the[type]=> -([name]=> -[type]=> - ) + ) -
So write yourself a way to deal with it.
1 if(Array_sum($_files[' Images '] [' Size ']) >0){2 $tmp=Array();3 foreach($_files[' Images '] as $k=$v) {4 foreach($v as $kk=$VV) {5 $tmp[$kk][$k]=$VV;6 }7 }8 $images=fab_upload ($tmp);9 $input[' Images ']=Serialize($images);
After processing the equivalent of more than one input box inpuit box corresponding to an upload file to get the $_files data, and then will contain an upload information (upload file in the server's storage path) to serialize, into the text storage type of storage field, when the picture is displayed, Of course it's unserialize deserialization!
Single input box uploads multiple file operations