I have put some mime
type validation on my Laravel controller to validate received file from mobile applications:
'file' => 'required_without:body|file|mimes:png,jpg,jpeg,mp3,mp4,pdf,doc,docx,m4a'
This validation rule is OK for most of files, but when iOS app sends recorded voice, this validation rule doesn't work.
Based on what iOS
developer says, the file's mime type is audio/m4a
but laravel (or maybe PHP) can't detect that.
I checked that $request->file('file')->getClientOriginalExtension()
returns audio/m4a
but $request->file('file')->guessExtension()
function returns null!
Any help is appreciated.