mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #2009 from coder2020official/fileupload
Fixes #1944: uploading file from memory
This commit is contained in:
commit
3960115ec7
@ -7250,7 +7250,7 @@ class InputFile:
|
|||||||
_file = open(file, 'rb')
|
_file = open(file, 'rb')
|
||||||
return _file, os.path.basename(_file.name)
|
return _file, os.path.basename(_file.name)
|
||||||
elif isinstance(file, IOBase):
|
elif isinstance(file, IOBase):
|
||||||
return file, os.path.basename(file.name)
|
return file, service_utils.generate_random_token()
|
||||||
elif isinstance(file, Path):
|
elif isinstance(file, Path):
|
||||||
_file = open(file, 'rb')
|
_file = open(file, 'rb')
|
||||||
return _file, os.path.basename(_file.name)
|
return _file, os.path.basename(_file.name)
|
||||||
|
Loading…
Reference in New Issue
Block a user