Beispiel #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
Beispiel #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
Beispiel #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)
Beispiel #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 
Beispiel #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
Beispiel #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)