上传菜单校验: 路径必须是文件, 目录提示用菜单 13 一键备份
This commit is contained in:
@@ -106,6 +106,9 @@ def upload() -> None:
|
||||
if not path or not os.path.exists(path):
|
||||
print(f"[错误] 文件不存在: {path}")
|
||||
return
|
||||
if not os.path.isfile(path):
|
||||
print(f"[错误] 不是文件 (目录上传请用菜单 13 一键备份): {path}")
|
||||
return
|
||||
server = _clean(input(f"服务器 [{_default_server()}]: ")) or _default_server()
|
||||
if not server.startswith(("http://", "https://")):
|
||||
server = "http://" + server # 只输 IP:端口 自动补协议
|
||||
|
||||
Reference in New Issue
Block a user