Sorry... I can't deal with all the SPAM so until I can find a better solution for the forums, I'm locking them down. For now please use awesome services like stackoverflow.com for community support. Thanks.
This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
Issue with FOLDER
  • I want my file upload to go a script. The script will handle the correct placement of the folder. However, Uploadify always adds the folder value when it does the post.

    Normally I'd ignore this. However, my script includes URL params:

    foo.cfm?event=X

    When the Flash file runs, it adds the folder with a ?. I end up with this URL:

    foo.cfm?event=X?folder=X

    This is a bug that could be easily fixed. If a ? is found in the script url, simply use &folder instead.

    Also, I'd say that if folder is not passed, then it shouldn't be passed to the script. (As it stands, I would _never_ trust a front end script to tell me where to save a file. That's a security risk if you ask me.)
  • This isn't a bug. You should be passing event in scriptData rather than as part of the script option. You will then get

    foo.cfm?folder=X&event=X

    If you don't want to use folder then ignore it. It's there for ease implementation for less advanced users.
  • Wow we have cfm royalty here now!

    Ray are you leaving the folder attribute in the script? You can just take it out and it shouldn't pass, I am using it like:


    <script type=\"text/javascript\">
    $(document).ready(function() {
    $(\"#fileUpload\").fileUpload({
    'uploader': '/swf/uploader.swf',
    'multi': false,
    'fileDesc': 'Image Files Only',
    'fileExt': '*.jpg;*.jpeg;*.png;*.gif;*.tif',
    'auto': 'true',
    'sizeLimit': '',
    'cancelImg': '/images/cancel.png',
    'script': 'upload.cfm',
    'scriptData': {'newFileID': '<cfoutput>#session.fileUpload.id#</cfoutput>'},


    then upload.cfm (well a basic version.. I use a larger upload script to recheck everything, which you know 1000x more than I do about it)


    <cfscript>
    thisPath = ExpandPath(\"*.*\");
    thisDirectory = GetDirectoryFromPath(thisPath);
    FileDir = thisDirectory &amp; \"uploads/\";
    FileDirThumb = FileDir &amp; \"thumbs/\";
    FileDirLarge = FileDir &amp; \"large/\";
    </cfscript>


    <cfif not DirectoryExists(FileDir)>
    <cfdirectory action=\"create\" directory=\"#FileDir#\" mode=\"777\" >
    </cfif>

    <cfif not DirectoryExists(FileDirThumb)>
    <cfdirectory action=\"create\" directory=\"#FileDirThumb#\" mode=\"777\" >
    </cfif>

    <cfif not DirectoryExists(FileDirLarge)>
    <cfdirectory action=\"create\" directory=\"#FileDirLarge#\" mode=\"777\" >
    </cfif>


    <cffile action=\"upload\"
    filefield=\"fileData\"
    destination=\"#FileDir#\"
    nameconflict=\"makeunique\" mode=\"777\">

    <cfscript>
    strFileName = trim(form.filename);
    strSourceFile = FileDir &amp; strFileName;
    destFileThumb = FileDirThumb &amp; strFileName;
    destFileLarge = FileDirLarge &amp; strFileName;
    </cfscript>

    <cfimage action=\"resize\" height=\"100\" width=\"\" source=\"#strSourceFile#\" destination=\"#destFileThumb#\" overwrite=\"yes\">
    <cfimage action=\"resize\" height=\" \" width=\"640\" source=\"#strSourceFile#\" destination=\"#destFileLarge#\" overwrite=\"yes\">

    <cfscript>
    fileDelete(strSourceFile);
    writeoutput(1);
    </cfscript>



    My biggest issue right now is I normally clean & rename the file after upload but passing that name back is where I am having troubles.
    I know I could do the upload and then do the db insert and then go back and get it and do the renaming and all that but that sure adds a ton of extra code that doesn't need to be there.
  • Royalty? Me? Nah. :)

    The biggest issue was me not using scriptData. When I did, that fixes almost everything. The next issue I had was with sessions, but I just added the session stuff to the data as well and everything worked fine.
  • I was just passing scriptData the session with a createUUID as a temp fix to rename the image until I can figure out how to pass back additional variables to the script but it isn't a very solid solution. What would rock is if the flash was in flex and it would be easier to just open up the connection with remoting... If only I had the time.....