#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    151
    Rep Power
    19

    calling dynamically created cffile result scope


    Hey there,

    I've got a dynamic utility for uploading files and it works great. The issue is i'm trying to then email those files out and need to call the dynamically created cffile result. In the past i've used structured syntax to call dynamically created form variables.
    Code:
    form['firstname#i#']
    But i don't know the scope to call for this particular variable.

    what i'm trying to do is this.... but the file field in the cfmailparam needs to be done differently.

    Code:
    <!---Upload the files--->
    <cfoutput>
                <cfloop from="1" to="#form.counter#" index="i">
                   
                    <cffile result="resumeUpload#i#"  action="upload" filefield="Form.file#i#" destination="#resumeloc#" nameconflict="MAKEUNIQUE">
                </cfloop>
                    <cfdump var="#form#"></cfdump>
    </cfoutput>
    
    
    
    <!---Attach the files in a cfmail tag --->
    <cfloop from="1" to="#form.counter#" index="i">
         <cfmailparam remove="true" file="#resumeloc##resumeUpload#i#.serverFile#">
     </cfloop>
    Any thoughts or suggestions?

    Thanks
    DSFX.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    151
    Rep Power
    19
    So after a day off, a cup of coffee and a bit of luck searching i figured it out. Didn't know i could do a dump on the entire variables scope. This would have come in handy earlier haha.

    Code:
    <cfloop from="1" to="#form.counter#" index="i">
          <cfset ResumeFile = variables[ 'resumeupload#i#' ].serverfile />
          <cfmailparam remove="true" file="#resumeloc##ResumeFile#">
     </cfloop>

IMN logo majestic logo threadwatch logo seochat tools logo