mirror of
https://github.com/koniu/recoll-webui.git
synced 2025-10-03 17:59:50 +02:00
Set Content-Length header in /download
This commit is contained in:
parent
1a249aa52f
commit
451f600159
1 changed files with 2 additions and 0 deletions
2
webui.py
2
webui.py
|
@ -296,6 +296,7 @@ def edit(resnum):
|
||||||
bottle.response.headers['Content-Disposition'] = \
|
bottle.response.headers['Content-Disposition'] = \
|
||||||
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
|
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
|
||||||
path = path.encode('utf-8')
|
path = path.encode('utf-8')
|
||||||
|
bottle.response.headers['Content-Length'] = os.stat(path).st_size
|
||||||
f = open(path, 'r')
|
f = open(path, 'r')
|
||||||
if pathismine:
|
if pathismine:
|
||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
|
@ -358,3 +359,4 @@ def main():
|
||||||
return {'url': url}
|
return {'url': url}
|
||||||
#}}}
|
#}}}
|
||||||
# vim: fdm=marker:tw=80:ts=4:sw=4:sts=4:et
|
# vim: fdm=marker:tw=80:ts=4:sw=4:sts=4:et
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue