How to limit the total max size?

Last post 09-24-2009, 10:39 AM by cutechat. 3 replies.
Sort Posts: Previous Next
  •  09-09-2009, 8:02 PM 55497

    How to limit the total max size?

    When using AjaxUploader for multi files uploading, I saw that I can limit the numbers of files with the MaxFilesLimit property and the size of each single file with the MaxSizeKB property.
    But is there a way to limit the total file size?
  •  09-09-2009, 9:25 PM 55500 in reply to 55497

    Re: How to limit the total max size?

    Hi,
     
    You can use the javascript to calcuate the size , and reject the files.
     
     
    And you need also calculate the size on server .
     
    Regards,
    Terry
     
  •  09-15-2009, 8:53 AM 55650 in reply to 55500

    Re: How to limit the total max size?

    Ok, thanks.
    I check the total file size inside the handler of the javascript "select" event of the UploadAttachments object.
    It has not been that straight forward because inside the "select" event handler, the parameter "files" contains only the files selected in the last "Browse" dialog opened, and it does not contain files eventually selected previously (supposing the user click more times on the "Browse" button to select files in different folder, and eventually remove files from the list of files selected). Anyway, I managed to make it work as I want.
     
    One question:
     
    The Javascript API documentation (http://ajaxuploader.com/document/scr/JavaScript-API.htm) only features the events that can be handled. Is there somewhere a documentation of the UploaderAttachements properties and method available on client script? I mean, after this line:
    var hidden=document.getElementById('<%=Uploader1.ClientID%>')
    what can I do with my object hidden?
  •  09-24-2009, 10:39 AM 55842 in reply to 55650

    Re: How to limit the total max size?

    Hi,
     
    Please use the last version.
     
    And it support this method:
     
    var hidden=document.getElementById('<%=Uploader1.ClientID%>')
    var items=hidde.getitems();
     
    --
     
    The javascript API do not helps the UploadAttachment.Items
     
    If you want you script access the Items info , you need implement it by your self.
     
    Regards,
    Terry
     
View as RSS news feed in XML