mercredi 23 décembre 2015

file upload laravel 5

Hi I'm trying to upload an image with laravel 5 function is: $file_name = ''; //validation of image before uploading and saving if( Input::hasFile('img') && Input::file('img')->isValid() ){ $file = Input::file('img');//creating an object $file_name = str_random(30) . '.' . $file-

getClientOriginalExtension();//randon str name to img file with the ext of
the original file $file->move( public_path() . '\assets\img', $file_name); }

form: multipart/form-data
input: input type="file" name="img" problem I always get an empty value to $file_name



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire