handleselect javascript method

Last post 11-02-2009, 9:03 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  10-29-2009, 2:49 PM 56796

    handleselect javascript method

    I am having trouble using your javascript API. I am trying to check if a file already exists in our system, as a user is attempting to upload a file. If it does exist, I need to give them a message asking if they want to overwrite the file. I am trying to use the handleselect method to grab the files that are being uploaded, but i can't seem to get the list of files being uploaded. Here's the code I'm using:

    uploader.handleselect =
    function() {
    alert(
    'handleselect');
    var items = this.getitems();
    alert(
    'Files selected: ' + items.length);
    return false;
    };
     
    If I use the CuteWebUI_AjaxUploader_OnSelect method, I can get to the files from the "files" parameter, but i think i need to use the handleselect method since i am trying to filter the list of files, then start the upload manually using startupload( ), which by the way doesn't seem to fire when i call it from another javascript method.
     
    Any ideas on how i can get to that list of files from handleselect, and also call startupload? Is there an on-line reference of the javascript methods available on the Uploader object, one that's more complete than http://ajaxuploader.com/document/index.htm#page=JavaScript-API.htm?
     
    Thanks...
  •  11-02-2009, 9:03 AM 56841 in reply to 56796

    Re: handleselect javascript method

    Hi,
     
    In the handleselect event , you can use the same parameters:
     
    uplaoder.handleselect=function(selectingitems)
    {
    }
     
    You should not use getitems() , because the selectingitems are not added into the uploader items yet.
     
    Regards,
    Terry
View as RSS news feed in XML