you can remove |mimes:xlsx,csv and dd() check the mime type
very old post: https://stackoverflow.com/questions/4212861/what-is-a-correct-mime-type-for-docx-pptx-etc
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I took an excel file from google spreadsheets and downloaded it to excel. When I upload it, I get an error message The upload must be a file of type: xlsx, csv., but if I take it directly from the ms.excel application, it works fine. this is my code
protected $rules = [
'type' => 'required|in:psb,mutasi',
'upload' => 'required|file|mimes:xlsx,csv',
];
@newbie360 it's application/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet.
thanks, you saved my day.
protected $rules = [
'type' => 'required|in:psb,mutasi',
'upload' => 'required|file|mimetypes:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
];
it works fine.
Please or to participate in this conversation.