Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Accessing my array variable

Explorer ,
Feb 01, 2010 Feb 01, 2010

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>

Picture 4.png

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.

524
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Feb 01, 2010 Feb 01, 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

Translate
Engaged ,
Feb 01, 2010 Feb 01, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 01, 2010 Feb 01, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 01, 2010 Feb 01, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 02, 2010 Feb 02, 2010
LATEST

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

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources