mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-28 23:59:57 +09:00
Enforce allowed filesize and type in extra var upload form
This commit is contained in:
parent
7fe2203cbd
commit
3ffeb63afb
3 changed files with 23 additions and 2 deletions
|
|
@ -11,6 +11,15 @@
|
|||
});
|
||||
$('input.rx_ev_file').on('change', function() {
|
||||
const container = $(this).parents('.ev_file_upload');
|
||||
const max_size = parseInt($(this).data('allowedFilesize'), 10);
|
||||
const file_count = this.files.length;
|
||||
for (let i = 0; i < file_count; i++) {
|
||||
if (max_size && this.files[i].size > max_size) {
|
||||
alert($(this).data('msgFilesize'));
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
}
|
||||
container.find('input[type=hidden][name^=_delete_]').val('N');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue