1 Reply Latest reply on Jan 27, 2009 8:44 AM by Newsgroup_User

    A help in upload

    thenotorious_flag Level 1
      Hi i am trying to upload 5 files in row using a loop. but it showing me an erro:

      here is the code i am tryinh:


      <cfloop from="1" to="5" index="idx">
      <cfoutput>
      <cfif form.upload#idx# IS NOT "">
      <cffile action="upload" filefield="upload#idx#" destination="#request.siteURL#core/#NewUploadDir#/"
      nameconflict="makeunique" accept="image/*">
      <cfset resizeFile = "#cffile.ServerFile#">
      <cfset imageCFC = createObject("component","core.cfc.image") />
      <cfset imageCFC.resize(','#request.file_path#core\#NewUploadDir#\#resizefile#','#request.file_pa th#core\#NewUploadDir#\rr_#resizefile#',150,150) />
      <cfif fileexists('#request.file_path#core\#NewUploadDir#\#resizefile#')>
      <cffile action="delete" file="#request.file_path#core\#NewUploadDir#\#resizefile#">
      </cfif>
      <cfset form.file#idx# = "rr_#resizefile#">
      <cfelse>
      <cfset form.file#idx# = "">
      </cfif>
      </cfoutput>
      </cfloop>


      it is showing me this error:

      Invalid CFML construct found on line 12 at column 28.
      ColdFusion was looking at the following text:

      #

      The CFML compiler was processing:
      A cfif tag beginning on line 12, column 12.
      A cfif tag beginning on line 12, column 12.
      A cfif tag beginning on line 12, column 12.
      A cfif tag beginning on line 12, column 12.

      The error occurred in C:\Inetpub\wwwroot\project1\upload.cfm: line 12
      10 : <cfloop from="1" to="5" index="idx">
      11 : <cfoutput>
      12 : <cfif form.upload#idx# IS NOT "">
      13 : <cffile action="upload" filefield="upload#idx#" destination="#request.siteURL#core/#NewUploadDir#/"
      14 : nameconflict="makeunique" accept="image/*">