I got some good suggestions as far as additions go and thought I would throw in 2 quick ones in today. The first is being able to set a max file size in the settings file. By default the max file size is 0 and if you don't change it then its up to the flash player to set the limit. If the user tries to upload a file that is greater than the max file size (measured in bytes) they will get an alert telling them they have exceeded the limit. So once you set a file limit how do we implement it? First off we need to look at how the browse process works.
1.) User clicks browse button
2.) onBrowse Event handler method is called
3.) Create a file reference list
4.) Add a Select event listener
5.) Call the file reference list browse method
Once the browse method is called the OS opens the open dialog box. Once a user selects a file or files the onSelectFile method is called. Now we have to loop through a list of files, if the user only selects one file then we will only do 1 loop. For each iteration we check check to see if the max file size is 0 (default) if so we just add the file to the array collection. If its not we check to see if the size exceeds our limit. If it does we display a friendly error message letting the user know what happened.
The second update was to allow for removing of multiple files which I covered in the last post

#1 by Johan on 8/1/08 - 4:51 PM
#2 by Dan Vega on 8/1/08 - 4:52 PM
#3 by Gareth Arch on 8/1/08 - 10:44 PM
#4 by Dan Vega on 8/1/08 - 10:51 PM
#5 by Adrian Lynch on 8/2/08 - 9:25 AM
http://www.adrianlynch.co.uk/images/temp/extension...
When I then click Upload I get the following:
http://www.adrianlynch.co.uk/images/temp/error.jpg...
Any idea what I might be doing wrong?
Cheers.
#6 by Tom Steeper on 8/25/08 - 11:34 AM
1. create the xml files on the fly prior to loading the flash file (could run into caching/timing issues).
2. modify the cfc to move the files after upload...but I still need to pass the path which would presumably have to be from a session variable.
Cool stuff by the way. I am very impressed, and have learnt a lot from reading your blogs, especially with me being a recent upgrader from CF5!!
#7 by Dan Vega on 8/26/08 - 9:58 AM
@Tom - Can you give me an example of what you are trying to do? Are you trying to set up different folders per user or something similar? There may be no way to do that without passing some flash vars in. I can probably just give you the source if you think that will help.
#8 by Tom Steeper on 8/26/08 - 12:44 PM
I have a backend document management system I am working on. I am currently using a CFTREE to browse/edit folders, but also the ability to upload docs to a chosen folder. I am passing the folder name to the page with CFMU file, and need this parameter for the upload folder.
Flashvars would work just great, though a look at the source would also be beneficial...but I understand why you would be reluctant to do so.
Thanks again for all the information you have posted.
Tom
#9 by Dan Vega on 2/5/09 - 3:19 PM