vendredi 27 novembre 2015

Laravel 5.1 multiple images upload issue

I am uploading multiple images from a single form file input. When i dd() the file field it returns single image.

Controller :

if(Input::hasFile('profile_pic')){
        $demo = $mobile->photo1 =  Input::file('profile_pic');
        dd($demo);
    }

View :

<div class="form-group">
 <label>Image Gallery</label>
 <input type="file" class="form-control" id="profile_pic" name="profile_pic" multiple>
</div>

Output of dd($demo) is :

UploadedFile {#29 ▼
  -test: false
  -originalName: "10422119_755988897809878_5614812569937154817_n.jpg"
  -mimeType: "image/jpeg"
  -size: 50782
  -error: 0
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire