* fix file size.

This commit is contained in:
wangyidong
2014-11-06 09:36:04 +00:00
parent 22dc72f739
commit 96341b35c3

View File

@@ -52,7 +52,11 @@ function checkSize(obj)
var sizeType = {'K': 1024, 'M': 1024 * 1024, 'G': 1024 * 1024 * 1024};
var unit = maxUploadInfo.replace(/\d+/, '');
var maxUploadSize = maxUploadInfo.replace(unit,'') * sizeType[unit];
var fileSize = $(obj)[0].files[0].size;
var fileSize = 0;
$(obj).parents('#fileform').find(':file').each(function()
{
if($(this).val()) fileSize += $(this)[0].files[0].size;
})
if(fileSize > maxUploadSize) alert('<?php echo $lang->file->errorFileSize?>');
}
}