milesj / uploader

[Deprecated] A CakePHP plugin for file uploading and validating.
MIT License
193 stars 73 forks source link

Handle images from input with multiple attribute #150

Closed diego-carrera closed 11 years ago

diego-carrera commented 11 years ago

Is there a way to handle files sent with a multiple attribute set?

<input type="file" name="data[Image][path][]" multiple/>

or

<input type="file" name="data[Image][][path] multiple/>

I've tried setting the name differently, it can be done iterating through

$this->request->data['Image']['path']

and creating a new image and saving it, just wondering if it is possible to do it whith save, or saveAll, without iterating throw the array

milesj commented 11 years ago

Off the top of my head, no, it's not possible. The way Cake structures the data that is passed to the Behavior doesn't allow for it. I'll look into it a bit more though.

milesj commented 11 years ago

After looking into it, it's not really possible since CakePHP tries to save them all as a single record. Would require a heavy rewrite of the AttachmentBehavior.