Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8123773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:16:43+00:00 2026-06-06T06:16:43+00:00

I am giving the form a dynamic number of file upload fields. So on

  • 0

I am giving the form a dynamic number of file upload fields. So on the form side, I’m looping through this dynamic number (say 3, as index ‘m’), and naming each filefield input ‘ResumeFile#m#’. On the action page, I’m getting an error if one of the filefields is not filled in. When all 3 filefields are filled in, it works fine.

The error is (here, when filefield 2 is not filled in):

    The form field Form.ResumeFile2 did not contain a file. 

Here’s my code creating the form:

    <cfset numUploads = 3>
    <cfform name="uploadMultipleResumes" action="uploadMultipleResumes.cfm" enctype="multipart/form-data" >
        <cfinput name="EmployeeID" type="hidden" value="#form.EmployeeID#">
        Resume File(s): *<BR>
        <cfloop from="1" to="#numUploads#" index="j">
            <cfinput name="ResumeFile#j#" type="file" size="50">
        </cfloop>
        <BR />
        <cfinput name="Submit" type="submit" value="Upload Multiple Resumes">
    </cfform>

Here’s my code (abbreviated) from the action page. I’ve tried lots of combinations of how to check if each filefield is not filled in, all of which allow a blank input to pass through and get to the error I mentioned above.

    <!--- Loop over multiple file fields --->
    <cfloop from="1" to="#numUploads#" index="m">
        <cfif 'Form.ResumeFile#m#' is not "">
            <cffile action="upload" filefield="#Evaluate('Form.ResumeFile#m#')#" nameconflict="makeunique" destination="#destinationPath#">
        </cfif>
    </cfloop>

Even if I’ve already tried it, I will try all suggestions! I’ve been on this for days and I know there’s an answer!

Thanks so much!

Here’s the image of the error

Blockquote

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:16:45+00:00Added an answer on June 6, 2026 at 6:16 am

    Change the code on your action page to the following:

    <!--- Loop over multiple file fields --->
    <cfloop from="1" to="#numUploads#" index="m">
        <cfif len(Form["ResumeFile#m#"])>
            <cffile action="upload" filefield="Form.ResumeFile#m#" nameconflict="makeunique" destination="#destinationPath#">
        </cfif>
    </cfloop>
    

    Fixed also some performance bottlenecks:

    1. Have in mind that one should if possible always avoid the use of
      evaluate().
    2. Use len() instead of IS NOT "" to check for a non empty string.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with dynamic number of rows. $(#tbl).append(<tr><td name=Date+i+ id=Date_+i+>+com_date+</td><td id=day_+ i+>+theday
I am submitting form via javascript by using 'document.FormName.submit()' . But this is giving
Form is not giving value on controller for sql.date i am using spring and
why is this query giving weird results.. SELECT max(greatest(home_team_total,away_team_total)) AS max_team_score, id FROM `match`
I am trying to attach a file with a contact form. My code looks
I am creating a form, and giving user three options. They can select only
I have a Select tag in the form in which i am giving the
I have a Rails form which has a number of tables. One of the
Following command giving me current month (March) in short form. SELECT left(datename(month, getdate()), 3)
This is code is giving an error(codeigniter code) Parse error: syntax error, unexpected T_OBJECT_OPERATOR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.