#227 Rewind Bytes in InputFile before send

This commit is contained in:
Oleg A 2019-11-30 03:59:33 +03:00
parent 56662d6bd8
commit 00b95466f5

View file

@ -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