2014-12-02 112 views
0

我正在寻找如何上传多个文件,比如一些这方面的教程:http://tutsglobal.com/discussion/301/how-to-upload-multiple-images-in-laravel-4Laravel - 上传多个文件

有一个{{ Form::file('images[]', ['multiple' => true]) }}线,应该让从输入选择多个文件。但问题是我只能选择一个文件而不能更多。我能做些什么来上传多个文件?


这是我的观点:

{{ Form::open(['action' => '[email protected]', 'files' => true, 'enctype' => 'multipart/form-data', 'class' => 'projectform']) }} 

    {{ Form::file('images[]', ['multiple' => 'multiple']) }} 

{{ Form::close() }} 

这是HTML输出:

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

我才发现,我可以选择与按住SHIFT键选择多个文件,但我d喜欢能够一个接一个地单独选择文件。

+0

如果你的窗体'content-type'设置为'multipart/form-data'? – Rafael 2014-12-02 10:13:52

+0

你能告诉我们表单的html输出吗? – Jerodev 2014-12-02 10:15:35

回答

1

提示:也许它对你有帮助。

<form action="demo_form.asp"> 
    Select images: <input type="file" name="img" multiple> 
    <input type="submit"> 
</form>