Skip to main content
Known Participant
February 1, 2010
解決済み

Accessing my array variable

  • February 1, 2010
  • 返信数 3.
  • 593 ビュー

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.

    このトピックへの返信は締め切られました。
    解決に役立った回答 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

    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.

    Hulfy作成者
    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_Cyr解決!
    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