Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Custom Message on maxNumberUploadError
  • Hello, I need a little bit of help implementing custom message on maxNumberUploadError.
    I am using the jGrowl.
    I am getting the standard javascript alert, instead I want to use a custome message the way jGrowl displays at onCancel or on file size.

    And even with the max queued size, I get the javascript alert that limit exceded but it still uploads all pics in queue, 10-20 does not matter.

    Thank you!
  • maxNumberUploadError is not an uploadify routine. More information is required if you want help
  • I changed nothing from the example codes downloaded from uploadify.com.
    I just want to add custom message on maxqueue size like this
    onCancel: function (a, b, c, d) {
    var msg = \"Cancelled uploading: \"+c.name;
    $.jGrowl('<p></p>'+msg, {
    theme: 'warning',
    header: 'Cancelled Upload',
    life: 4000,
    sticky: false
    });
    },


    Here is the code.

    <script type=\"text/javascript\">

    $(document).ready(function() {
    $(\"#fileUploadgrowl\").fileUpload({
    'uploader': 'uploadify/uploader.swf',
    'cancelImg': 'uploadify/cancel.png',
    'script': 'uploadify/upload.php',
    'folder': 'files',
    'fileDesc': 'Image Files',
    'fileExt': '*.jpg;*.jpeg;*.png;*.gif',
    'multi': true,
    'simUploadLimit': 1,
    'maxQueueSize': 6,
    'sizeLimit': 3145728,
    onError: function (event, queueID ,fileObj, errorObj) {
    var msg;
    if (errorObj.status == 404) {
    alert('Could not find upload script. Use a path relative to: '+'<?= getcwd() ?>');
    msg = 'Could not find upload script.';
    } else if (errorObj.type === \"HTTP\")
    msg = errorObj.type+\": \"+errorObj.status;
    else if (errorObj.type ===\"File Size\")
    msg = fileObj.name+'<br>'+errorObj.type+' Limit: '+Math.round(errorObj.sizeLimit/1024)+'KB';
    else
    msg = errorObj.type+\": \"+errorObj.text;
    $.jGrowl('<p></p>'+msg, {
    theme: 'error',
    header: 'ERROR',
    sticky: false
    });
    $(\"#fileUploadgrowl\" + queueID).fadeOut(250, function() { $(\"#fileUploadgrowl\" + queueID).remove()});
    return false;
    },
    onCancel: function (a, b, c, d) {
    var msg = \"Cancelled uploading: \"+c.name;
    $.jGrowl('<p></p>'+msg, {
    theme: 'warning',
    header: 'Cancelled Upload',
    life: 4000,
    sticky: false
    });
    },
    onClearQueue: function (a, b) {
    var msg = \"Cleared \"+b.fileCount+\" files from queue\";
    $.jGrowl('<p></p>'+msg, {
    theme: 'warning',
    header: 'Cleared Queue',
    life: 4000,
    sticky: false
    });
    },
    onComplete: function (a, b ,c, d, e) {
    $(\"#filesUploaded\").append(\"<input type='text' name='\"+c.name+\"' value='\" +d+ \"' />\"); //adds hidden form field to uploadedpics div
    var size = Math.round(c.size/1024);
    $.jGrowl('<p></p>'+c.name+' - '+size+'KB', {
    theme: 'success',
    header: 'Upload Complete',
    life: 4000,
    sticky: false
    });
    }
    });
    });


    I did not nothing to it. Also it upload all files in queue even if more then 6!

    I dd update the uploadify js to 1.6.2 with the maxquesize implemented.
  • Your trying to do something that i not in uploadify. maxQueueSize is not a valid uploadify option. Read the documentation for valid options. If you want to implement queue size monitoring, search the forum for queueSize. I have previously posted manually queue monitoring code. Otherwise wait for the next version; a queue size limit has been added to version 2
  • I saw it is not a native function.
    How long, do you think, until version 2?

    At least how to I delete the queue from file 7 upwards?
    For now it just alerts but does not delete the queue or not post files, they get uploded no matter how many in queue.

    Anyway, thanks for a great plugin!
  • Hopefully we should be releasing it in the next couple of weeks.