def web_remote_file():
remote_path = request.args.get('path')
if not remote_path:
return "No remote path given."
local_path, name = get_remote_file(remote_path)
if not local_path:
return "Remote file '{}' not found.".format(remote_path)
res = send_from_directory(local_path, name, as_attachment=True)
shutil.rmtree(local_path)
return res
# ########################################################################### #
# API Part #
# ########################################################################### #
评论列表
文章目录