Level 3
Check this http://stackoverflow.com/questions/21564029/file-upload-mime-type-validation-with-laravel-4 It fails to recognize the mime_content_type and tells application/octet-stream as a generic/fallback type.
Hello!
I have an application based on Laravel 5 with file upload functionality. Everything works fine except uploading of some PDF files.
The applications can not upload some of PDF files, and when I try to open them, they seems normal like any other PDF files. Any idea how to solve this problem?
dd($request); //MyRequest $request
// Here is the part of dd($request) related to file
+files: FileBag {#244 ▼
#parameters: array:1 [▼
"file" => UploadedFile {#27 ▼
-test: false
-originalName: "111.pdf"
-mimeType: "application/octet-stream"
-size: 0
-error: 1
}]}
//Here is my request rules
return ['file' => 'mimes:pdf|max:10000',
While for other PDF files are just working fine like bellow dd($request)
+files: FileBag {#244 ▼
#parameters: array:1 [▼
"file" => UploadedFile {#27 ▼
-test: false
-originalName: "cv.pdf"
-mimeType: "application/pdf"
-size: 28141
-error: 0
}]}
Please or to participate in this conversation.