I have read couple of post regarding the issue of checking the file extension while upload a file using laravel.
I have the same issue and didn't file the solution even if spending an hour behinding the silly thing.
this is my validation rule looks like.
public function rules() { return [ 'sheet' => 'required', 'file' => 'mimes:csv', ]; }
However required is working file but on mimes.
I tried couple of other ways i founded like:
return [ 'file' => ['required', 'mimes:csv'] ]
return [ 'file' => ['required', 'mimes:text/csv'] ]
Above none of line is working sometime says not valid file sometime passes through the validation.
I doubted for invalid file, then I downloaded fresh sample file from Microsoft site. That not the issue at all.
Can anyone help me?
Thanks!
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1QzarYt
via IFTTT
Aucun commentaire:
Enregistrer un commentaire