mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
Add file size limit error
This commit is contained in:
parent
077e7c00d5
commit
ee47c21eed
1 changed files with 1 additions and 0 deletions
|
|
@ -1123,6 +1123,7 @@ class Client(Methods, BaseClient):
|
||||||
progress_args: tuple = ()):
|
progress_args: tuple = ()):
|
||||||
part_size = 512 * 1024
|
part_size = 512 * 1024
|
||||||
file_size = os.path.getsize(path)
|
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))
|
file_total_parts = int(math.ceil(file_size / part_size))
|
||||||
is_big = True if file_size > 10 * 1024 * 1024 else False
|
is_big = True if file_size > 10 * 1024 * 1024 else False
|
||||||
is_missing_part = True if file_id is not None else False
|
is_missing_part = True if file_id is not None else False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue