Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
    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)
Пример #4
0
    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 
Пример #5
0
    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
Пример #6
0
    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)