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