0

我正在使用 Valums-File-Uploader VERSION 2.1.2,它来自https://github.com/Valums-File-Uploader/file-uploader

现在,成功上传文件后,我想立即将文件名和大小保存到 Sqlserver。

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);
    }})

如何从 Valums-File-Uploader onComplete 获取 fileSize 并将其作为参数传递给服务器?非常感谢您的帮助!

4

1 回答 1

0
  1. 在您的服务器已处理文件并返回响应后,将调用 onComplete 回调。
  2. 您引用的存储库几个月前被放弃了。您应该使用Widen/fine-uploader
于 2013-02-24T13:11:25.240 回答