mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
#227 Rewind Bytes in InputFile before send
This commit is contained in:
parent
56662d6bd8
commit
00b95466f5
1 changed files with 4 additions and 0 deletions
|
|
@ -138,6 +138,10 @@ def compose_data(params=None, files=None):
|
|||
else:
|
||||
filename, fileobj = guess_filename(f) or key, f
|
||||
|
||||
# rewind to start of the file
|
||||
if hasattr(fileobj, 'seekable') and fileobj.seekable():
|
||||
fileobj.seek(0)
|
||||
|
||||
data.add_field(key, fileobj, filename=filename)
|
||||
|
||||
return data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue