This commit is contained in:
j 2012-01-26 09:13:48 +05:30
parent 01f7e31685
commit b7bb4a4e80

View file

@ -43,7 +43,7 @@ def HttpFileResponse(path, content_type=None, filename=None):
if filename: if filename:
if isinstance(filename, unicode): if isinstance(filename, unicode):
filename = filename.encode('utf-8') filename = filename.encode('utf-8')
response['Content-Disposition'] = 'attachment; filename="%s"' % filename response['Content-Disposition'] = 'attachment; filename="%s"' % filename
response['Expires'] = datetime.strftime(datetime.utcnow() + timedelta(days=1), "%a, %d-%b-%Y %H:%M:%S GMT") response['Expires'] = datetime.strftime(datetime.utcnow() + timedelta(days=1), "%a, %d-%b-%Y %H:%M:%S GMT")
return response return response