From 36b27e733c83e02ac54d7a6c1aa0a43938d1fc1f Mon Sep 17 00:00:00 2001 From: cyfraeviolae Date: Sat, 27 Aug 2022 05:46:17 -0400 Subject: key com --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app.py') 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): -- cgit v1.2.3