cffile can't upload more than 1 file at a time

Description

When attempting to upload multiple files with multiple file input fields, an error is thrown "form field [form.upload_1] is not a file field, valid field names are [upload_2, upload_1]."

Sample code:

<cfif structcount(form)> <cfif len(trim(form.upload_1))> <cffile action="upload" filefield="form.upload_1" destination="your destination path here" > </cfif> <cfif len(trim(form.upload_2))> <cffile action="upload" filefield="form.upload_2" destination="your destination path here" > </cfif> </cfif> <form method="post" enctype="multipart/form-data"> <input type="file" name="upload_1" /><br /> <input type="file" name="upload_2" /><br /> <input type="submit" value="upload" /> </form>

Environment

None

Activity

Show:

Sean S. 11 October 2016 at 17:28

Thanks!

Michael Offner 10 October 2016 at 18:49

workaround: remove "form." from "filefield" attribute

Michael Offner 10 October 2016 at 18:48

i can reproduce

Michael Offner 10 October 2016 at 18:44

please test with most recent snapshot, we did some changes with cfform since 5.0.0.254

Fixed

Details

Assignee

Reporter

Priority

Labels

Fix versions

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

Affects versions

Created 10 October 2016 at 17:22
Updated 7 September 2020 at 08:44
Resolved 11 October 2016 at 09:44

Flag notifications