This commit is contained in:
danra 2014-10-31 15:42:52 +00:00
commit 806ed07d8f

View File

@ -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'])