mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Merge e77320fa5b
into 0b864acd98
This commit is contained in:
commit
806ed07d8f
|
@ -1006,7 +1006,8 @@ class ImageField(FileField):
|
||||||
if hasattr(data, 'temporary_file_path'):
|
if hasattr(data, 'temporary_file_path'):
|
||||||
file = data.temporary_file_path()
|
file = data.temporary_file_path()
|
||||||
else:
|
else:
|
||||||
if hasattr(data, 'read'):
|
if hasattr(data, 'read') and hasattr(data, 'seek'):
|
||||||
|
data.seek(0)
|
||||||
file = BytesIO(data.read())
|
file = BytesIO(data.read())
|
||||||
else:
|
else:
|
||||||
file = BytesIO(data['content'])
|
file = BytesIO(data['content'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user