我正在使用 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 并将其作为参数传递给服务器?非常感谢您的帮助!