Try uploading the file to a page like this to check the mime
https://htmlstrip.com/mime-file-type-checker
Be aware that you are checking mime, not extension
Is it possible for Laravel App to ignore a specific file txt and allowed another file txt ? I build an app where I can store some file(test) and the upload does work just fine with validation working(sometimes). When I try to upload this file: File_dataAndEveryThingUseless.txt the validation fails Error: The upload must be a file of type: csv, doc, docx, log, pdf, ppt, pptx, rtf, txt, xls, xlsx, xml. But when i upload this file: EpicTest.txt, it passes...
Here the validation code:
$validation = request()->validate([
'category' => ['required', 'numeric'],
'upload' => ['required', 'file', 'max:5120', 'mimes:csv,doc,docx,log,pdf,ppt,pptx,rtf,txt,xls,xlsx,xml'],
]);
And also, why other file like registry.reg passes too ? Do you have to use mimeType validation ? Any thoughts ?
Try uploading the file to a page like this to check the mime
https://htmlstrip.com/mime-file-type-checker
Be aware that you are checking mime, not extension
Please or to participate in this conversation.