fix #205: Bug with attachments whose filename contains a space. Tnx sjrd.

This commit is contained in:
slav0nic 2011-08-23 12:50:55 +03:00
parent 971326e1bc
commit 8f6985ddb6

View file

@ -764,7 +764,7 @@ def show_attachment(request, hash):
attachment = get_object_or_404(Attachment, hash=hash)
file_data = file(attachment.get_absolute_path(), 'rb').read()
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