我有一个用于上传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文件?
答案 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