samedi 23 janvier 2016

Laravel 5.1 Validation failing on correct mime/extension

I use a request class for my validation. I have a request class that has this piece of code in there:

public function rules()
{
    $rules = [
        'attachment'  => 'mimes:png,jpg,gif'
    ];
}

Doing a $request->file('attachment')->getClientMimeType() in my controller returns image/png

Yet whenever I try to send a png file I'm still getting a validation error: "The attachments must be a file of type: png, jpg, gif."

Am I missing a step?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire