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

CFMU Bug Fix - Using External Interface

Word Count: 376

In my CFMU project I am using the ExternalInterface class. This class allows your application to communicate with the flash players container, in this case the ColdFusion template and JavaScript. I originally was giving users the ability to define a JS function that would be called when all of the files were uploaded. I had a couple people email telling me that it was just not working how it should be. When they were uploaded files the JavaScript method was being called right away while the file uploads were still in progress.

As soon as I heard this I realized what I had done. Let's take a look at the following code. When a user selects some files for upload and clicks on the upload button the following method is called. The variable _files is an array collection that holds a list of File references. The File Reference class has a method upload that is used to push the file to a remote server. You will also notice that I add some event listeners to each file. This lets us monitor the progress of the upload and is important for the feature we are working. The problem here is that I am calling the external interface method after each file is sent for upload. This does not mean that the file has actually been uploaded, just that Flash has done it's part. So what would happen is the list of files would immediately show up right after the user clicked upload and this is not what we want.

[More]

CFMU 1.0 Released

Tags: CFMU
Word Count: 127
I am happy to announce the release of my CFMU project as its finally hit version 1.0. I was able to fix a couple bugs so I figured no time like the present to get this out. I was able to fix one bug that was forwarded to me by a user. The user was having an issue with the max file size, basically it just was not working. The problem was with the flash vars being passed into the application. Its important to note that flash vars are case sensitive when your reading them in. If you have a second and you have not checked out the project yet, please do and let me know your thoughts.

Ask An Addict: CFMU upload and insert

Tags: CFMU
Word Count: 407

I got this question from a user so I thought I would share it with everyone.

Anyway, I downloaded your CFMU tag and think it's amazing. I'd really like to be able to make use of it but would need to know the names of the files it uploads for storing in a database etc. I've been scratching my head over the OnComplete Advanced example you gave in the documentation but my JavaScript is useless and my ColdFusion knowledge just isn't good enough to work out a different way!

First off thanks for the kind words! Ok so the on complete method is really there to be used as a callback method. This will allow you to call a javascript method after the files have been uploaded. While I guess you could use this to make Ajax calls to your backend and write to a database I think there is a better way to go about this. If you download the latest zip I have added a new example.

Remember that all the uploader tag does is push the file to a specific URL. This is the example code from my the demo upload and insert. As you can see there is a URL attribute. This is the URL that gets called everytime we upload a file.

So we know its going to call a component name ImageHandler.cfc and a method named upload. Basically Flash passes the filename through a form variable to our remote method. The same way that we use the form.filename field to upload the file, we can use it to insert the name into a database. This example is very basic but as you can see we are uploading the image and adding it to our database. You could even take this a step further and wrap it in a transaction so that if either fail you can just rollback.

CFMU updated

Tags: CFMU
Word Count: 103
I update my CFMU project to run on the latest Flex 4 framework which means you will need flash player 10 from now on. In the update I was able to fix a bug. If you are using the current project I suggest you update to the latest. If you had a list of files in the data grid and went to remove a file in the list it was removing the wrong one. Basically there was a problem with removing the wrong index. This was submitted to me by a user so thanks for the heads up!

CFMU Project Screencast

Tags: CFMU,Flex
Word Count: 98

I wanted to sit down tonight and create a screencast to go through a couple things. I wanted to make people aware of my CFMU project and use it as an example of how I setup some of Flex projects. I have had some emails / questions come in lately about how to do certain things but before I get to that I needed to get together a good work environment. With that said click on the image below to watch the screencast. Please leave me some comments with any suggestions you have.

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.

[More]

CFMU on complete attribute

Tags: CFMU,Flex
Word Count: 97

The next feature of CFMU I want to go over is the on complete attribute. This allows you to define a JavaScript method name that will be called after the files have been uploaded. This will run every time you upload a single file or a batch of files. In addition to calling the method of your choice it will also pass an array of the files that were uploaded and will contain the following info about each file.

  • creationDate
  • creator
  • modificationDate
  • name
  • size
  • type

[More]

CFMU File Filters

Tags: CFMU
Word Count: 146

CFMU is a multiple file upload custom tag written for ColdFusion in Flex. This is a much easier way to allow users the ability to upload files in your applications. If it is only 1 file it really is not a big deal but when you need to add many files this custom tag really comes through. Over the next couple of weeks I want to keep walking you through the many features this tag has to offer as well as how the code on the Flex side works.

Today we are going to walk through file filters. A file filter is a way to restrict what kind of files a user can select when clicking the browse button. This firstre image is the custom tag rendered to the screen along with the little code it takes.

[More]

CFMU is back and better than ever

Word Count: 186

A while ago I started a project code named CFMU. The name was clearly some of my best work yet because it stood for ColdFusion Multi Uploader. I wanted to be able to quickly add a multiple file uploader in my applications and i wanted to be able to display progress to the user so naturally the Flash platform was a good fit. I had written many uploader components in Flex before so it was a fun little project.

Since the initial release I have got a ton of feedback and most of the issues were related to installation and usage issues. The customization was done via an XML file and quite frankly it did not work as well as I wanted it to. I decided to re write this project so it was easier to use and I think I have come through. I have turned it into a custom tag so all customizations are done by passing tag attributes and I was able pass all of the settings to the application using flash vars.

[More]

More Entries

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