Uploaded image for project: 'Lucee Development'
  1. LDEV-1028

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

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.254
    • Fix Version/s: 5.0.1.71
    • Labels:
      None

      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>
      

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              byrning Sean Stewart
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: