1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 02:10:24 +00:00

i18n for multifile upload and using html5 for file size checking

This commit is contained in:
zhengxie
2012-11-27 11:17:14 +08:00
parent 22b07ffe3c
commit 81417a0bc2
4 changed files with 256 additions and 198 deletions

View File

@@ -52,6 +52,18 @@ $('#upload-file-form .submit').click(function () {
return false;
}
var total = 0;
$.each($('#upload-file-form input[type=file]'), function() {
if($(this).val()) {
total += this.files[0].size;
}
});
if (total > {{ max_upload_file_size }}) {
$('#upload-file-form .error').html('{% trans "File size surpasses the limit." %}').removeClass('hide');
return false;
}
$('#upload-file-form .error').addClass('hide');
$.fn.MultiFile.disableEmpty(); // disable dummy element before submiting the form