More robust attachments serve

remotes/origin/enhancement/email-actions
Jesús Espino 2014-08-20 09:28:13 +02:00
parent e0a5e6cca5
commit c956eeaee3
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class RawAttachmentView(generics.RetrieveAPIView):
response['X-Accel-Redirect'] = "/{filepath}".format(filepath=name) response['X-Accel-Redirect'] = "/{filepath}".format(filepath=name)
response['Content-Disposition'] = 'attachment;filename={filename}'.format( response['Content-Disposition'] = 'attachment;filename={filename}'.format(
filename=os.path.basename(name)) filename=os.path.basename(name))
response['Content-Type'] = mimetypes.guess_type(attachment.url) response['Content-Type'] = mimetypes.guess_type(name)
return response return response