Subject: | HTML5 bug, $c->req->uploads will return a scalar if there is one upload |
HTML5 introduces `multiple` on form uploads, unfortunately the browser
doesn't transmit anything to indicate that the type is multiple.
-----------------------------18910739318893266631096981613 Content-
Disposition: form-data; name="picture[]";
filename="3a97abfcccdb1067d3f1db01acc0d2cf.jpg" Content-Type: image/jpeg
Here is an example of this html5 tag.
<input type="file" name="upload[]" multiple="true">
By convention this tag seems to use /[]$/ suffix in the name. So I'm
going to make the suggestion that all $c->req->uploads that end in /[]$/
be of type ArrayRef rather than Scalar. Currently, if you upload one
file $c->req->upload('upload[]') will be a scalar, and if you upload
more than one $c->req->upload('upload[]') will be an array ref.
--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com