Skip to main content
Known Participant
February 1, 2010
Answered

Accessing my array variable

  • February 1, 2010
  • 3 replies
  • 591 views

I have a form that can attach multiple files, it uses a bit of jquery

<cfform action="index.cfm" method="post" class="P10" style="padding:20px; border:1px solid red;">
<cfinput type="file" name="multi" class="multi" maxlength="2"/>
<input  type="submit" name="submit" value="submit" />
</cfform>

The input is called multi, I presume it is an array or stucture.  but how can i access the structure?

I tried <cfdump var="#FORM.mult[0]i#" /> but they do not seem to work? Any ideas?

Thanks,

H.

    This topic has been closed for replies.
    Correct answer Joshua_Cyr

    It rather looks like it isn't creating multiple fields but the file name as comma delimited list for that one field.  You should be able to do the same thing easily with the new cffileupload tag in CF 9.

    http://www.remotesynthesis.com/post.cfm/multi-file-uploads-with-coldfusion-9-in-5-lines

    3 replies

    BKBK
    Community Expert
    Community Expert
    February 1, 2010
    The input is called multi, I presume it is an array or stucture.

    No, form.multi is a string

    I tried <cfdump var="#FORM.mult[0]i#" /> but they do not seem to work? Any ideas?

    Another reason that wouldn't work, aside from form.multi being a string, is that the variable is incorrectly spelt.

    HulfyAuthor
    Known Participant
    February 2, 2010

    thanks, spelling error was only in my post, but you are right. must be a comma sep. list.

    Thanks

    Inspiring
    February 1, 2010

    The previous answer told you it was a list.  You can loop through that list to get the individual file names.

    Joshua_CyrCorrect answer
    Participating Frequently
    February 1, 2010

    It rather looks like it isn't creating multiple fields but the file name as comma delimited list for that one field.  You should be able to do the same thing easily with the new cffileupload tag in CF 9.

    http://www.remotesynthesis.com/post.cfm/multi-file-uploads-with-coldfusion-9-in-5-lines