mardi 8 novembre 2016

Laravel - document extension validation rule

I have a document upload field and I am validate it in laravel using this rule:

'document' => 'required|mimes:doc,docx,rtf,txt,xls,xlsx,ppt,pdf|max:1536'

It works fine on the validations. I realized it allowed csv too, I came to know that mime type for csv will be text so that's what it allows it. I tried to upload .sql that worked too.

What is the best way to have validation based on extension of a document?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire