Solved

Help please <cfloop issue

Posted on 2014-02-21
8
176 Views
Last Modified: 2014-02-26
Hi,

How can I pass my counter thru this loop.
the files name that I have are:
file_1
file_2
file_3

 <cfset maxFiles = 3>
 
 <cfloop from="1" to="#maxFiles#" index="counter">
 
  <cfdump var="#Form.file_#counter#">

 </cfloop>
0
Comment
Question by:lulu50
  • 4
  • 4
8 Comments
 
LVL 4

Expert Comment

by:Rodrigo Munera
ID: 39877700
You can use brackets:

#form["file_" & counter]#
0
 

Author Comment

by:lulu50
ID: 39878003
no I can't
0
 

Author Comment

by:lulu50
ID: 39878024
Error Occurred While Processing Request
File '' does not exist.

 value="#FileReadBinary(form["file_" & counter])#">


can't use double cote
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 4

Expert Comment

by:Rodrigo Munera
ID: 39878029
use single quote

value="#FileReadBinary(form['file_' & counter])#">
0
 
LVL 4

Expert Comment

by:Rodrigo Munera
ID: 39878033
Or the other way around:

value='#FileReadBinary(form["file_" & counter])#'>
0
 

Author Comment

by:lulu50
ID: 39886841
no I still have an error

The tag must be nested inside a cfquery tag.

I tried:

 <cfqueryparam cfsqltype="cf_sql_blob"
              value='#FileReadBinary(form["file_" & counter])#'>

and this

<cfqueryparam cfsqltype="cf_sql_blob"
              value="#FileReadBinary(form['file_' & counter])#">
0
 
LVL 4

Accepted Solution

by:
Rodrigo Munera earned 500 total points
ID: 39886909
You can't save files like that,
you must first upload the file to your server
https://wikidocs.adobe.com/wiki/pages/viewpage.action?pageId=87505342

and then you can use filereadbinary
https://wikidocs.adobe.com/wiki/display/coldfusionen/FileReadBinary
0
 

Author Closing Comment

by:lulu50
ID: 39888879
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Build PDF in coldfusion 2 71
a php service which i want to use in coldfusion 2 108
paging 3 46
Coldfusion UNIX/EPOCH Time Conversion - Time Zone? 11 48
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question