Multiple files upload using CakePHP Uploader

2.2k views Asked by At

Is it possible to upload multiple files (images in particular) using CakePHP Uploader and HTML5 multiple attribute? And of course save those images with hasMany relation, eg Project hasMany Image.

EDIT:

I am using CakePHP 2.x, this is the Uploader. I have tried adding multiple attribute to input, but seems that is not working, only saves 1 image. Miles is suggesting multiple inputs, I wanted to use only one input field for this matter. So the question above stands.

1

There are 1 answers

0
MrSynAckSter On

The simple answer is: Not out of the box. Multiupload widgets are actually kind of tricky (as you need to change the behavior of the upload panel. My weapon of choice for this is: http://blueimp.github.io/jQuery-File-Upload/

A very simple javascript example is provided here: http://kajda.com/scripts/multiupload/js/multiupload.js

Alternatively, you could have a field that takes multiple drag and drops (using HTML5) instead of the upload panel. Check this one out: http://www.9lessons.info/2012/09/multiple-file-drag-and-drop-upload.html