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:
@@ -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
|
||||
|
Reference in New Issue
Block a user