mardi 15 mars 2016

Laravel image upload returning the PHP path?

Uploading images to S3 with laravel and having issues with this site when its worked fine before.

When returning the image from the form I get:

/Applications/MAMP/tmp/php/php4SKXfX

My form is:

{!! Form::model($user, [
    'url' => ['user', $user->username],
    'class' => '',
    'files' => true,
    'method' => 'patch'
]) !!}
    {!! Form::file('profile_image', NULL, ['class' => 'form-control'] ) !!}
    {!! Form::button("Update Profile Image", ['type' => 'submit', 'class' => 'btn btn-success'])!!}
{!! Form::close() !!}

The error I was getting from my class was:

file_get_contents() expects parameter 1 to be a valid path, object given

I have used this class before, but not working with this form I am making.

The way I am getting the image is:

return $request->file('profile_image');

Where am I going wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire