From: Jan Szejko Date: Mon, 16 Jan 2017 12:43:45 +0000 (+0100) Subject: validate filename length X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/205ab78251b8219e78b684d15adafb72720003d8 validate filename length --- diff --git a/stage2/static/js/checkfile.js b/stage2/static/js/checkfile.js index 5482688..36afefc 100644 --- a/stage2/static/js/checkfile.js +++ b/stage2/static/js/checkfile.js @@ -14,6 +14,10 @@ $(function() { alert('Błędne rozszerzenie! Powinno być: ' + ext); ok = false; } + if (name.length > 100) { + alert('Za długa nazwa pliku! Maksymalna długość: 100 znaków (jest: ' + name.length + ')'); + ok = false; + } } var size = this.files[0].size; if (size > 20 * 1024 * 1024) {