|
a/webui.py |
|
b/webui.py |
|
... |
|
... |
302 |
# Else this is a subdocument, extract to temporary file
|
302 |
# Else this is a subdocument, extract to temporary file
|
303 |
xt = rclextract.Extractor(doc)
|
303 |
xt = rclextract.Extractor(doc)
|
304 |
path = xt.idoctofile(doc.ipath, doc.mimetype)
|
304 |
path = xt.idoctofile(doc.ipath, doc.mimetype)
|
305 |
pathismine = True
|
305 |
pathismine = True
|
306 |
bottle.response.headers['Content-Disposition'] = \
|
306 |
bottle.response.headers['Content-Disposition'] = \
|
307 |
'attachment; filename=%s' % os.path.basename(path).encode('utf-8')
|
307 |
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
|
308 |
print >> sys.stderr, "Sending %s with mimetype %s" % (path, doc.mimetype)
|
308 |
print >> sys.stderr, "Sending %s with mimetype %s" % (path, doc.mimetype)
|
309 |
f = open(path, 'r')
|
309 |
f = open(path, 'r')
|
310 |
if pathismine:
|
310 |
if pathismine:
|
311 |
os.unlink(path)
|
311 |
os.unlink(path)
|
312 |
return f
|
312 |
return f
|