【问题标题】:HTML multi input file is sending one input onlyHTML 多输入文件仅发送一个输入
【发布时间】:2017-11-04 14:07:06
【问题描述】:

我的表单中有这个输入代码:

<input name="photos" type="file"  multiple>

在我处理表单输入的控制器类中:-

$photos = Input::file('photos');
        $count = count($photos);

我使用 count() 方法只是为了确定表单是否正在发送多个文件。 count 方法的返回是“1”,而我选择了 6

【问题讨论】:

    标签: php html forms laravel input


    【解决方案1】:

    通过更改输入名称解决,来自:-

    <input name="photos" type="file"  multiple>
    

    收件人:

    <input name="photos[]" type="file"  multiple>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-18
      相关资源
      最近更新 更多