Commit d715d3e2 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Use idoctofile in all cases (no direct file:// urls, this was wrong for...

Use idoctofile in all cases (no direct file:// urls, this was wrong for compressed files). Needs recoll 1.23.3
parent b6b0df9f
......@@ -311,14 +311,11 @@ def edit(resnum):
doc = rclq.fetchone()
bottle.response.content_type = doc.mimetype
pathismine = False
if doc.ipath == '':
# If ipath is null, we can just return the file
path = doc.url.replace('file://','')
else:
# Else this is a subdocument, extract to temporary file
xt = rclextract.Extractor(doc)
path = xt.idoctofile(doc.ipath, doc.mimetype)
pathismine = True
xt = rclextract.Extractor(doc)
path = xt.idoctofile(doc.ipath, doc.mimetype)
pathismine = True
bottle.response.headers['Content-Disposition'] = \
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
path = path.encode('utf-8')
......
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