From ee47c21eedc69ee6d6f92484bd6373b16e2887a1 Mon Sep 17 00:00:00 2001 From: Alexandr Date: Fri, 19 Oct 2018 23:39:29 +0700 Subject: [PATCH] Add file size limit error --- pyrogram/client/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index b19bb486..d4afd9be 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1123,6 +1123,7 @@ class Client(Methods, BaseClient): progress_args: tuple = ()): part_size = 512 * 1024 file_size = os.path.getsize(path) + assert file_size < 1500 * 1024 * 1024, "Couldn't upload file bigger 1500MiB" file_total_parts = int(math.ceil(file_size / part_size)) is_big = True if file_size > 10 * 1024 * 1024 else False is_missing_part = True if file_id is not None else False