From 205ab78251b8219e78b684d15adafb72720003d8 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 16 Jan 2017 13:43:45 +0100 Subject: [PATCH] validate filename length --- stage2/static/js/checkfile.js | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.20.1