filesizevalums-file-uploader

how does Valums-File-Uploader get fileSize in onComplete and pass it to server as params


I am using Valums-File-Uploader VERSION 2.1.2,It comes from https://github.com/Valums-File-Uploader/file-uploader.

Now, after uploading file successfully,I want to save file name and size to Sqlserver at once.

new qq.FileUploader({
    element: document.getElementById('file-uploader'),
    action: '/ashx/FileHandler.ashx',
    //filename: fileName, filesize: filesize, 
    params: { action: 'uploadfile', filename: fileName, filesize: filesize},------filesize from onComplete function
    autoUpload: true,
    extraDropzones: [qq.getByClass(document, 'qq-upload-extra-drop-area')[0]],
    // Max file size limit
    sizeLimit: 5200000,
    // This function is executed once uploaded.
    // This is appends the filenames to a div, but it could be anything!
    onComplete: function (id, fileName, responseJSON) {
        if (responseJSON.success) {
            $('#uploaded_files').append('<br />uploaded: "' + fileName + '" ');
         ----------- how to set file size to a local variable  filesize

        }
        msgShow(responseJSON.msg);
    }})

how can I get fileSize from Valums-File-Uploader onComplete and pass it to server as params? thanks a lot in advance for any help!


Solution

    1. The onComplete callback is invoked after your server has already processed the file and has returned a response.
    2. The repo you referenced was abandoned months ago. You should be using Widen/fine-uploader.