mime类型的上传文件是application / octet-stream失败

时间:2018-04-02 05:52:06

标签: laravel-5 file-upload

我有一个用于上传pdf文档的表单,并且正在我的控制器中使用laravel验证,例如

$validator = Validator::make($request->all(), [
       'document' => 'required|mimes:jpeg,jpg,png,pdf|max:25600',
]);

一些图像和pdf文档mime类型,如 application / octet-stream

有没有办法检查application / octet-stream文件mime是png,jpeg还是pdf文件?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,这不是Laravel问题。

我修复了此修改

php.ini

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M ; from 5M to 10M

; Must be greater than or equal to upload_max_filesize
post_max_size = 10M  ; from 5M to 10M