Laravel文件上载错误内容长度
错误 App.phpLaravel文件上载错误内容长度,laravel,eloquent,Laravel,Eloquent,错误 App.php Warning: POST Content-Length of 31492035 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 控制器创建 'allowedFileTypes' => 'jpg,jpeg,bmp,png,pdf,mp4', 'maxFileSize' => 10000000000*2, 8388608字节是8M,这是PHP中的默认限制。将php.ini中的post_
Warning: POST Content-Length of 31492035 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
控制器创建
'allowedFileTypes' => 'jpg,jpeg,bmp,png,pdf,mp4',
'maxFileSize' => 10000000000*2,
8388608字节是8M,这是PHP中的默认限制。将php.ini中的
post_max_size
更新为更大的值
upload\u max\u filesize
设置用户可以上载的最大文件大小,而post\u max\u size设置通过表单中的post发送的最大数据量
因此,您可以将
upload\u max\u file size
变大。我将post\u max\u size=8M
更改为post\u max\u size=50M
,并刷新了WampServer。同样的错误有什么建议吗?
$rules = ['attachments.*' => 'required|mimes:'.$allowedFileTypes.'|max:'.$maxFileSize];
Storage::put($destinationPath.$fileName.'.'.$file->getClientOriginalExtension(),file_get_contents($file->getRealPath()));