summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/app.py b/app.py
index 800b263..01bdef6 100644
--- a/app.py
+++ b/app.py
@@ -133,7 +133,8 @@ def FileSizeLimit(max_bytes, magic_start=None, magic_end=None):
if not field.data:
return
s = field.data.read()
- n = len(field.data.read())
+ n = len(s)
+ print(max_bytes, n)
if n > max_bytes:
raise ValidationError(f"File size must be less than {max_bytes}B")
if magic_start and not s.startswith(magic_start):