def GET(self, base): f = get_file(base) if not f: return app.notfound() if not f.type == 2: return app.notfound() metafile = f.metafile() web.header('Content-type', 'text/plain') return metafile.content
def GET(self, base): f = get_file(base) if not f: return app.notfound() web.header('Content-type', f.mime) web.header('Content-disposition', 'attachment; filename=' + f.name) data = '' with open(os.path.join(config.UPLOAD_DIRECTORY, f.filename)) as f: data = f.read() return data
def GET(self, base): f = get_file(base) if not f: return app.notfound() metafile = f.metafile() if metafile: return render_plain.render(metafile.template)(f, metafile) return render_plain.upload(f)