This commit is contained in:
2025-01-07 20:18:34 +08:00
parent 6f3a7c2ecc
commit 540d8c4e5b
10 changed files with 42 additions and 42 deletions

2
ftp.py
View File

@ -64,7 +64,7 @@ def upload_directory_to_ftp(server, username, password, local_directory, remote_
local_file_path = os.path.join(root, filename) # 本地文件的完整路径
relative_path = os.path.relpath(local_file_path, local_directory) # 计算相对路径
remote_file_path = os.path.join(remote_directory, relative_path).replace("\\", "/") # 计算远程文件路径
upload_file_to_ftp(server, username, password, local_file_path, remote_file_path, proxy_url) # 上传文件
upload_file_to_ftp(server, username, password, local_file_path, remote_file_path) # 上传文件
except ftplib.all_errors as e:
print(f"上传目录时发生错误: {e}")