Allow uploading all files of an <input type="file" multiple>

Description

Currently, you have two possibilities to upload files, fileUpload() and fileUploadAll() (resp. <cffile action="fileupload"> and <cffile action="fileuploadall">). The former allows you to upload a single file of a given form field, the latter uploads all files of a request.

Unfortunately, fileUpload() only uploads a single file of the given form field, even when you have set the multiple attribute on the <input type="file">. fileUploadAll(), on the other side, uploads all files of the whole form, which may be spread over multiple <input type="file"> elements, which you may want to handle differently.
There is no option to handle all the files - and just those - of a single <input type="file" multiple>.

So I suggest to change the functionality of fileUpload() to handle all the files of a given field and output an array of structs like fileUploadAll() does. If changing the default behavior causes compatibility problems, then this could be controlled via an additional argument multiple, defaulting to false.

Activity

Show:

Sebastian Zartner 9 August 2018 at 19:44

Thank you for updating the docs!

Zac Spitzer 9 August 2018 at 13:35

fair point, that does makes sense

You also prompted me to improve the Lucee docs to explicitly mention that fileUploadAll supports multiple files and processes all the files in form fields in the request, thanks!
http://docs.lucee.org/reference/functions/fileuploadall.html

Sebastian Zartner 9 August 2018 at 10:50

> We could also add an attribute to fileUploadAll which lets you restrict which form fields are processed?

That would be another option, though I found it more intuitive to make the change to fileUpload(), because that function is already restricted to a single form field. Allowing to restrict fileUploadAll() seems to be against its name.

Zac Spitzer 9 August 2018 at 07:51

We could also add an attribute to fileUploadAll which lets you restrict which form fields are processed?

Sebastian Zartner 8 August 2018 at 23:27

Corresponding Adobe ColdFusion ticket:
https://tracker.adobe.com/#/view/CF-4203252

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Priority

Created 8 August 2018 at 13:44
Updated 12 January 2023 at 12:41

Flag notifications