Skip to main content
Participating Frequently
March 20, 2008
Question

What Is The Best Way To Upload A Bunch Of Items At Once?

  • March 20, 2008
  • 4 replies
  • 1468 views
Using ColdFusion 7 or 8 - What is the best way to upload a bunch of items at once?

For example:

Let's say a user wanted to be able to up load 20 .jpg pictures into a website directory and have that automatically loaded into a pictures table where 1 field was the filename like:

pic1.jpg
mypic2.jpg
summercamp.jpg

etc.
    This topic has been closed for replies.

    4 replies

    Inspiring
    August 23, 2009

    not Sure:

    CF returns details of the file in #cffile.serverfile#

    well i did not understood the questiuon properly but still a try

    Participant
    March 26, 2008
    The absolute best one I've found is CF_FlashUpload:

    http://www.cftagstore.com/tags/cfflashupload.cfm

    Ray
    Participant
    April 10, 2008
    quote:

    Originally posted by: raymajoran
    The absolute best one I've found is CF_FlashUpload:
    http://www.cftagstore.com/tags/cfflashupload.cfm
    Ray


    It's not obvious (to me, at least) from the documentation that this can be configured for multiple file uploads at once. Is this possible?
    Thanks,
    Les


    Participating Frequently
    March 1, 2009
    I've been looking for several days at examples of using a flash file uploader. I was after single or multiple file uploads, a progress bar and the ability to add "vanilla" form fields. The most promising I found was the YUI uploader from those nice people at Yahoo http://developer.yahoo.com/yui/examples/uploader/u...

    I got it working fine submitting to a simple CF page

    <cfif structkeyexists(form,"Filedata")>
    <cffile action="UPLOAD" filefield="Filedata" destination="#expandpath(".")#" nameconflict="OVERWRITE">
    </cfif>

    <cfif structkeyexists(form,"var1") and structkeyexists(form,"var2")>
    <cffile action = "append" file = "#expandpath(".")#\log.txt" output = "var1 = #var1# var2 = #var2#">
    </cfif>

    I'm a complete novice with Javascript, PHP, flash in fact anything other than CF, so there's a bit I don't understand (well several ... but this one in particular!)

    On the example in the YUI documentation they say they are using this PHP scrip to handle server side

    1 <?php
    2 foreach ($_FILES as $fieldName => $file) {
    3 move_uploaded_file($file['tmp_name'], "./" . $file['name']);
    4 echo (" ");
    5 } ?>

    The echo bit seems to "bounce back" the post data which is then picked up by the onuploadresponse(event). In CF how would I pass back some response to the calling page to fire this event?
    Participating Frequently
    March 20, 2008
    I would suggest using some fancy uploader plugins such as jQuery one.

    http://plugins.jquery.com/project/MultiFile

    Just my 2 cents. :)
    March 20, 2008
    You can also check out the Yahoo UI Library's Uploader (( http://developer.yahoo.com/yui/uploader/ )). If you have a flickr account you can go here >> http://www.flickr.com/photos/upload/ << and upload a few images to see how this solution can be implemented. Note that Yahoo tags the Uploader as "experimental".
    Inspiring
    March 20, 2008
    Hi,

    Try this CF_FileUpload custom tag (available free at Adobe Exchange).