Commit 451f6001 authored by Yves Fischer's avatar Yves Fischer Committed by koniu
Browse files

Set Content-Length header in /download

parent 1a249aa5
......@@ -296,6 +296,7 @@ def edit(resnum):
bottle.response.headers['Content-Disposition'] = \
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
path = path.encode('utf-8')
bottle.response.headers['Content-Length'] = os.stat(path).st_size
f = open(path, 'r')
if pathismine:
os.unlink(path)
......@@ -358,3 +359,4 @@ def main():
return {'url': url}
#}}}
# vim: fdm=marker:tw=80:ts=4:sw=4:sts=4:et
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment