当我使用ajax请求在laravel项目中上载多个文件时,该请求始终在网络面板中显示待处理,但是当我上载或仅选择一个文件时,该文件便可以工作。我找不到问题所在。我还使用了jQuery验证。请帮助-
HTML:
<input type="file" multiple id="product-image" name="file[]">
JS:
submitHandler: function (form) {
var serializeData = new FormData($(form).get(0));
serializeData.append('description',$('#summernote-description').code());
$.ajax({
processData: false,
contentType: false,
enctype: 'multipart/form-data',
method: $(form).attr('method'),
data: serializeData,
url: $(form).attr('action'),
success:function(msg){
console.log(msg);
}
控制器:
public function store(Request $request)
{
dd($request->all());
}