|
a/webui.py |
|
b/webui.py |
|
... |
|
... |
293 |
xt = rclextract.Extractor(doc)
|
293 |
xt = rclextract.Extractor(doc)
|
294 |
path = xt.idoctofile(doc.ipath, doc.mimetype)
|
294 |
path = xt.idoctofile(doc.ipath, doc.mimetype)
|
295 |
pathismine = True
|
295 |
pathismine = True
|
296 |
bottle.response.headers['Content-Disposition'] = \
|
296 |
bottle.response.headers['Content-Disposition'] = \
|
297 |
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
|
297 |
'attachment; filename="%s"' % os.path.basename(path).encode('utf-8')
|
298 |
print >> sys.stderr, "Sending %s with mimetype %s" % (path, doc.mimetype)
|
298 |
path = path.encode('utf-8')
|
299 |
f = open(path, 'r')
|
299 |
f = open(path, 'r')
|
300 |
if pathismine:
|
300 |
if pathismine:
|
301 |
os.unlink(path)
|
301 |
os.unlink(path)
|
302 |
return f
|
302 |
return f
|
303 |
#}}}
|
303 |
#}}}
|