Table Of Contents
 

CF_ProFlashUpload Processing Uploaded Files

Author : Daniel Mackey Email : dan@digital-crew.com

Performing custom processing on the uploaded file

Use the attribute includeOnUpload to pass the name of a file that will process the uploaded file.
The path to your custom file is from the same directory that holds the "dccom" folder (typically the application root).

Example:

<cf_dccom component="ProFlashUpload" includeOnUpload="inc_resizeImages.cfm" ...>

In this example the "inc_resizeImages.cfm" should be in the same folder that holds the dccom directory.
The name of the uploaded file is stored in File.ServerFile.

You could check the file extension at this point: <cfif ListLast( File.ServerFile, "." ) EQ "jpg"> <!---- RESIZE THIS JPEG ---> </cfif>

Here is some example code that just adds a ".processed" extension to the uploaded file:

<!--- Make the newly upload file as processed --->
<cffile action="RENAME" source="#ATTRIBUTES.folder##File.ServerFile#" destination="#ATTRIBUTES.folder##File.ServerFile#.processed">

Passing Your Own Attributes

All attributes you pass when calling ProFlashUpload are your include file.

e.g. If you pass a custom attributes folderId like so:

<cf_dccom component="ProFlashUpload" folderId="#URL.folderId#"...>

Then ATTRIBUTES.folderId is available to your include file!

Handling Errors

No doubt you will at some stage have errors in your processing template file.
The last 5 generated errors are stored in the ProFlashUpload folder under
dccom/components/proflashupload/ and are named error1.txt, error2.txt, error3.txt etc.

Getting the names of uploaded files for additional processing

This was requested so often that we made if a part of the component!

Just pass the attribute fileListVariable and the list of uploaded files will be store in SESSION[fileListVariable].

Example:

<cf_dccom component="ProFlashUpload" fileListVariable="uploadedFiles" ...>

Then when the component is finished uploading, the list of files is stored in SESSION.uploadedFiles.
(Note: You may find it useful to redirect the user to another page when finished uploading using the redirectURL option.)

Examples