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.
UploadiFive 1.1.1 has been released which includes a small fix for added support on touch devices including iOS 6 devices.
Send scriptData when doing checkScript
  • Hi

    Great plugin! I turned to Uploadify after trying other 'solutions' which just didn't work.

    Anyway, I have been passing a subfolder to my upload.php script via scriptData so I could put files in individual subfolders depending on which user was logged in.

    However, this confused check.php as it was only looking in 'folder'.

    "No problem!", I thought, "I'll just check my 'subfolder' POST variable in check.php".

    BUT! Uploadify was not passing scriptData when doing a checkScript call.

    So I modified Uploadify thus....


    (Look around line 163 in jquery.uploadify-v1.6.2/ jquery.uploadify (Source).js)


    $(this).bind(\"rfuCheckExist\", {'action': settings.onCheck}, function(event, checkScript, fileQueue, folder, single) {
    var postData = new Object();
    postData.folder = pagePath + folder;
    for (var queueID in fileQueue) {
    postData[queueID] = fileQueue[queueID];
    if (single) {
    var singleFileID = queueID;
    }
    }

    // Fix for http://www.tovotutor.com
    // ALSO send scriptData variables
    for (var s in settings.scriptData) {
    postData[s] = settings.scriptData[s];
    }
    // end of f




    Then you can access scriptData as normal...e.g. $_POST['subfolder']

    **** but make sure you avoid your scriptData variables like this... ***
    check.php
    if ($key != 'folder' && $key!='subfolder' && $key!='anothervar'' && ..... ) {



    I hope this helps other with a similar problem.

    Russell
  • hi Russel ...

    sorry for my poor english, but i have the same problem, i need validate if the file exist in distinct folders via $GET and my script works perfectly, the problem i see is the version with you version uploadify 1.6.2 and i use the version 2.1.4

    how can i do this with this version?

    tx!!!

    version 2.1.4

    jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {
    var postData = new Object();
    postData = fileQueueObj;
    postData.folder = (folder.substr(0,1) == '/') ? folder : pagePath + folder;
    if (single) {
    for (var ID in fileQueueObj) {
    var singleFileID = ID;
    }
    }

    jQuery.post(checkScript, postData, function(data) {
    for(var key in data) {
    if (event.data.action(event, data, key) !== false) {
    var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");
    if (!replaceFile) {
    document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key,true,true);
    }
    }
    }
    if (single) {
    document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);
    } else {
    document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);
    }
    }, "json");
    });