Web Trenches

jQuery Uploadify – checkScript Example for ColdFusion

All of the programming that comes with the Uploadify plug-in for jQuery is done in PHP.  I've converted the new checkScript feature to use ColdFusion instead.

checkfileexists.cfm —–

<cfset returnArray = arrayNew(1) />
<cfloop list=”#form.fieldnames#” index=”i”>
    <cfif i NEQ “folder” AND fileExists('#expandpath(form.folder)#\#form[i]#')>
            <cfset arrayAppend(returnArray,form[i]) />
<cfcontent reset =”true” /><cfoutput>#serializeJSON(returnArray)#</cfoutput><cfabort>

——- end checkfileexists.cfm ——

The cfcontent and cfabort tags on the last line probably aren't necessary, but they will prevent any content or spacing in the header/footer of your site from interfering with the JSON that is returned.

To call this file, you would point to it in the uploadify function.  For example:

                        'uploader': '/path/to/uploadify.swf',
                        'script': '/path/to/files.cfm',
                        'folder': 'myfiles',
                        'cancelImg': '/path/to/cancel.png',
                        'checkScript': '/path/to/checkfileexists.cfm'

3 Replies to “jQuery Uploadify – checkScript Example for ColdFusion”

  1. Hi Mike,

    SORRY to post an unrelated comment, but I can’t seem to find an email address for you anywhere.

    Over on longtailvideo.com you posted this article: goo.gl/Sr1U

    I’m having the same issue, and would appreciate seeing how you ended up implementing it. Everything loads fine, except the video. It says the video cannot be found.

    Thanks for your help in advance!


Leave a Reply

Your email address will not be published. Required fields are marked *