Ejemplo n.º 1
0
def get_id_by_filename(key, filename):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    oid = api.oid_by_name(user, filename)
    if oid:
        return oid
    abort(404)
Ejemplo n.º 2
0
def link_to_file(key, oid):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    url = api.url_for(user, oid)
    if url:
        return url
    abort(404)
Ejemplo n.º 3
0
def link_to_file(key, oid):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    url = api.url_for(user, oid)
    if url:
        return url
    abort(404)
Ejemplo n.º 4
0
def get_id_by_filename(key, filename):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    oid = api.oid_by_name(user, filename)
    if oid:
        return oid
    abort(404)
Ejemplo n.º 5
0
def debug_upload_file(key):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    return '''
    <!doctype html>
    <title>Upload new File</title>
    <h1>Hey %s! Upload a new file</h1>
    <form action="" method=post enctype=multipart/form-data>
      <p><input type=file name=file>
         <input type=submit value=Upload>
    </form>
    ''' % user
Ejemplo n.º 6
0
def debug_upload_file(key):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    return '''
    <!doctype html>
    <title>Upload new File</title>
    <h1>Hey %s! Upload a new file</h1>
    <form action="" method=post enctype=multipart/form-data>
      <p><input type=file name=file>
         <input type=submit value=Upload>
    </form>
    ''' % user
Ejemplo n.º 7
0
def upload_file(key):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    return api.save_file(user, request.files['file'])
Ejemplo n.º 8
0
def upload_file(key):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    return api.save_file(user, request.files['file'])