0

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!

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
Kevin Auds
  • 174
  • 1
  • 4
  • 15

1 Answers1

0
  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.
Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
  • thanks ! I get filesize and name from server manually. The repo I referenced is still working and the latest is paid version. – Kevin Auds Feb 27 '13 at 01:16
  • No, the repo you referenced is not still working, and it does not contain the "paid" version you mentioned. That particular repo has been dead for months now. Click on the link you provided and have another look at the recent activity. – Ray Nicholus Feb 27 '13 at 03:43