CFMU on complete advanced example

Tags: CFMU
Word Count: 89

In the last example I introduced you to the on complete attribute for CFMU. Today I want to take it a step further and sprinkle in some jQuery magic. Before we look at some code we should take a look at what we are trying to accomplish. When the uploader loads we are going to add some files to it.

After we hit upload and the files are uploaded we will display our results to the right of the uploader.

Now that we know what we are shooting for lets run through some code. As I said yesterday CFMU has an on complete attribute. This is a string name of the JavaScript method you want to call when the files have been completed. We are also going to create a div that will hold our results

Our log files method automatically gets passed an array of files that have been uploaded. From there we really only need to do 2 things. First our results div is automatically set to hide when the page loads so I want to make it visible. Next using the each function in jQuery we can loop our array. If you remember from yesterday I said you would get passed a ton of info about each file, well 1 of them is the name. For each array item we are going to append the item to our results div.

This example and many more are available in the download so please go check out the project on RIAForge. As always your feedback is welcomed.

Comments

#1 Posted By: Sami Hoda Posted On: 4/15/09 3:50 PM
Keep up the good work. I'm following this project closely.
#2 Posted By: Lee Boardman Posted On: 7/2/09 4:23 AM
This tag is amazing but I just have a question. Rather than display the image names on the right, I'd like to be able to store them in a database, or at least store them as a session array (if they aren't already). My knowledge is fairly limited so any guidance you can offer would be much appreciated.


Post Your Comment

Leave this field empty







Show Captcha

If you subscribe, any new posts to this thread will be sent to your email address.

Copyright © 2007 Dan Vega | BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.