laravel accept multiple files submitted by form
世界只因有你
世界只因有你 2017-05-27 17:43:30
0
2
791

Code:
html:
<input type="file" name="img" multiple="multiple" />
php:
$file=$request-> file('img');

After selecting multiple pictures through input in the web page, select the file name to accept in the background, but only one file can be accepted. Why is this?
I hope God can give me some advice, urgent! ! ! ! !

世界只因有你
世界只因有你

reply all(2)
Ty80

html :

    <input type="file" name="img[]" multiple="multiple" />
    

php :

    $file = $_FILES['img'];
世界只因有你
<input type="file" name="img[]" multiple="multiple" />

多个文件的话 name='' 必须加 []数组形式
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!