1
0
Fork 0
mirror of https://github.com/koniu/recoll-webui.git synced 2025-10-03 09:49:25 +02:00

Set Content-Length header in /download

This commit is contained in:
Yves Fischer 2014-11-12 21:53:12 +01:00 committed by koniu
parent 1a249aa52f
commit 451f600159

View file

@ -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