Exemple #1
0
def sample_get_file_url(filename):
    user = api.current_user()
    if user:
        oid = api.oid_by_name(user, filename)
        if oid:
            return api.url_for(user, oid)
    return ''
Exemple #2
0
def sample_get_file_url(filename):
    user = api.current_user()
    if user:
        oid = api.oid_by_name(user, filename)
        if oid:
            return api.url_for(user, oid)
    return ''
Exemple #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)
Exemple #4
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)
Exemple #5
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 ''
Exemple #6
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 ''