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 ''
def upload_file(key): user = api.user_by_key(key) if not user: abort(404) return api.save_file(user, request.files['file'])