mardi 1 décembre 2015

Laravel file upload just uploads .tmp file

For some reason this did not work in my view:
{!! Form::open(['url'=>'notes','file'=>true]) !!}

So I just used this which seemed to get me a little further:
{!! Form::open(['url'=>'notes','enctype'=>'multipart/form-data']) !!}

In the store method of my PostsController I have the following:

$file = Input::file('picture');
$file->move(public_path(). /pictures/');

When I try uploading the .jpeg file, a .tmp file gets uploaded into the right folder but its just a .tmp file that says "The file cannot be displayed in the editor because it is either binary, very large or uses and unsupported text encoding."

Not sure why its not uploading the .jpeg file itself.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire