in MimeTypeExtensionGuesser, it's defining the mime-type for .eml as
message/rfc822
So I guess the next step is to see whether your .eml file mimetype is actually message/rfc822
hello there, I've got a file upload form that uses the mimes validation rule to validate the type of file being uploaded. I'd would like to update this to allow email files with the .eml extension, but I can't get them to pass validation. The MimeTypeExtensionGuesser.php file has "eml" in the array which makes me think it should work. Here's my validation code.
$validator = Validator::make($request->all(), [
'fileName' => 'required',
'file' => 'required|mimes:pdf, doc, docx, rtf, txt, eml'
]);
Can anyone who's made validation for this type of file before tell me what I'm doing wrong?
Alternatively, I've considered the possibility that laravel is guessing the wrong mime type based on the file. Is it possible to see what mime type laravel has determined the file to be through the Validator facade?
I'm using laravel 5.2, any help is very appreciated!
Does uploading a PDF or Word document work correctly?
Maybe try to leave off the "spaces" after a comma:
$validator = Validator::make($request->all(), [
'fileName' => 'required',
'file' => 'required|mimes:pdf,doc,docx,rtf,txt,eml'
]);
Please or to participate in this conversation.