Esempio n. 1
0
def sample_save_from_filesystem(filename):
    user = api.current_user()
    if user:
        try:
            fileHandle = api.File(filename)
            oid = api.save_file(user, fileHandle)
            return api.url_for(user, oid)
        except IOError:
            pass
    return ''
Esempio n. 2
0
def upload_file(key):
    user = api.user_by_key(key)
    if not user:
        abort(404)
    return api.save_file(user, request.files['file'])