X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/d4e30da6169912cf6de8557a5dcb8b978b5d9fb5..3f560301f4b16f82439bed8cc30588dbc150eb50:/stage2/static/js/checkfile.js diff --git a/stage2/static/js/checkfile.js b/stage2/static/js/checkfile.js index 5482688..19db762 100644 --- a/stage2/static/js/checkfile.js +++ b/stage2/static/js/checkfile.js @@ -14,10 +14,15 @@ $(function() { alert('Błędne rozszerzenie! Powinno być: ' + ext); ok = false; } + if (name.length > 65) { + alert('Za długa nazwa pliku! Maksymalna długość: 65 znaków (jest: ' + name.length + ')'); + ok = false; + } } + var max_size = this.getAttribute('data-max') || 20; var size = this.files[0].size; - if (size > 20 * 1024 * 1024) { - alert('Rozmiar pliku nie może przekraczać 20 MB!'); + if (size > max_size * 1024 * 1024) { + alert('Rozmiar pliku nie może przekraczać ' + max_size + ' MB!'); ok = false; } if (!ok) {