Fix #857: Fix broken upload for specific files when using S3 storage

This commit is contained in:
Eliot Berriot 2019-06-13 11:05:28 +02:00
parent d52e804a3c
commit 0a25243e25
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
3 changed files with 11 additions and 1 deletions

View file

@ -12,7 +12,7 @@ def guess_mimetype(f):
t = magic.from_buffer(f.read(b), mime=True)
if not t.startswith("audio/"):
# failure, we try guessing by extension
mt, _ = mimetypes.guess_type(f.path)
mt, _ = mimetypes.guess_type(f.name)
if mt:
t = mt
return t