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 either 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.
We could also add an attribute to fileUploadAll which lets you restrict which form fields are processed?
> 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.
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!
Thank you for updating the docs!