fix #205: Bug with attachments whose filename contains a space. Tnx sjrd.
This commit is contained in:
parent
971326e1bc
commit
8f6985ddb6
1 changed files with 1 additions and 1 deletions
|
@ -764,7 +764,7 @@ def show_attachment(request, hash):
|
||||||
attachment = get_object_or_404(Attachment, hash=hash)
|
attachment = get_object_or_404(Attachment, hash=hash)
|
||||||
file_data = file(attachment.get_absolute_path(), 'rb').read()
|
file_data = file(attachment.get_absolute_path(), 'rb').read()
|
||||||
response = HttpResponse(file_data, mimetype=attachment.content_type)
|
response = HttpResponse(file_data, mimetype=attachment.content_type)
|
||||||
response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(attachment.name)
|
response['Content-Disposition'] = 'attachment; filename="%s"' % smart_str(attachment.name)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue