我正在尝试将新文件上传到FTP,这些文件已在本地目录中添加到服务器中的相同目录中。
无论如何我能做到这一点吗?请帮帮我。我将不胜感激。
谢谢!
答案 0 :(得分:0)
只需使用支持同步的任何命令行Windows FTP客户端。
例如,使用WinSCP scripting,您可以使用其synchronize
command:
winscp.com /log=ftp.log /command ^
"open ftp://username:password@ftp.example.com/" ^
"synchronize remote c:\local\path /remote/path" ^
"exit"
根据您的要求,循环批处理文件或schedule it in Windows scheduler。
对于实时同步,您还可以使用keepuptodate
command。
winscp.com /log=ftp.log /command ^
"open ftp://username:password@ftp.example.com/" ^
"keepuptodate c:\local\path /remote/path" ^
"exit"
(我是WinSCP的作者)