Skip to main content
April 4, 2011
Question

CFFile action="uploadall" question

  • April 4, 2011
  • 1 reply
  • 3420 views

I am doing a cffile uploadall process and I want to return a list/array of filenames uploaded.  It doesn't seem like it should be too hard - should it?

Thanks.

    This topic has been closed for replies.

    1 reply

    Inspiring
    April 4, 2011

    Take a look at the CF documentation.  It states: After a file upload is completed, this tag creates an array of structures specified by the result parameter. Each structure in the array contains upload result information for one file. For information on the result structure contents, see cffile action = "upload".

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7388.html

    April 4, 2011

    Here's my code:

    Upload page -

    <cffileupload
    hideuploadbutton="no"
    progressbar= "no"
    stoponerror="yes"
    title="Upload Closeout Pictures"
    url="process.cfm?pro_num=#pro_num#&type=#urlencodedformat(form.type)#"
    wmode="transparent"
    maxfileselect=6 />

    <cfif isDefined("myImage.serverfile")>
          wow
    <cfelse>
          hey
    </cfif>

    Processing page -

    <cffile
    action="uploadall"
    destination="#path#"
    nameconflict="overwrite"
    result="myImage" />

    I get nothing in the myImage variable.

    Inspiring
    April 7, 2011

    I changed my database design to account for this "feature".  It sucks a little but it's working now.

    Thanks for your help.


    Perhaps a UI with six file input controls labeled pic 1-6 would be better suited to your site. That would allow you to contol which file corresponds to pics 1-6.