CFMU Update: onCompleteAll

Tags: CFMU
Word Count: 540

A couple people have asked about fixing up the events and with a prior release I was able to fix the on complete method. The on complete method will call a JavaScript method using the ExternalInterface library after each item in the list has been uploaded. Now that that works we needed a way to notify the client that all files were uploaded. After each file is successfully uploaded that file is removed from the files array. A quick check to see the length will let us know when we are done with all of the files

With that I decided to whip up a quick demo which is also in the download. This example will write each file name to the browser screen as its uploaded and then write out a message that all files are done.

If you want to downloaded the latest version along with all of the demos you can get it over at the CFMU Project Page on RIAForge

Comments

#1 Posted By: Ken Smith Posted On: 8/17/09 10:56 AM
Great! Love it! Thanks so much for this and for your help.
#2 Posted By: Brendan Canty Posted On: 8/18/09 1:58 PM
First off, this uploader is great, I'm enjoying playing with and trying to get it to work in my environment.

One small question I have, the onComplete method returns the name of the file, but it is returning the name of the file that the user uploaded, not necessarily the name of the file on the server, since cffile is using "nameconflict='makeunique'".

Is there an easy way to have the onComplete method become aware of the eventual filename on the server?
#3 Posted By: Dan Vega Posted On: 8/20/09 6:13 PM |
Author Comment
Because it is on the server I don't think there is really anything I can do but I will look into for you. One option you could upload to a temp directory, read that directory and compare the results with the list of files and then move them to where you want them to go.
#4 Posted By: Newton C. Posted On: 3/28/10 6:36 PM
Hi Dan,

I love what you have done! This is one of a kind.
Even though CF9 has a multifile upload tag cffileupload, I still like yours.

I have a problem though. I wanted to implement maxFiles and maxFileSize on oncompleteAdv, but once I add those attributes they do not work. Have you tried it?

Please give me a solution.

Thank you in advance.
#5 Posted By: Dan Vega Posted On: 3/30/10 8:20 AM |
Author Comment
The max files and max file size have nothing to do with onComplete event that fires. The max attributes should stop the user from adding files that exceed that attribute. If max files are 10 they should not be allowed to add more than 10 files at a time. The on complete is an event that will fire after the files have been uploaded.
#6 Posted By: Newton C. Posted On: 4/1/10 9:18 PM
Yes, I know what you mean. That's what I wanted to do, restrict file no. and upload size each time, but when I add those attributes in oncompleteAdv, they do not work. I mean when I put MaxFiles= "5" and MaxFileSize = "100", I am still able to upload more than 5 files and bigger than 100 at a time.

I need a solution. Thank you.


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.