使用FTP将文件上载到多个文件夹

时间:2011-05-18 14:01:43

标签: file ftp directory

我想一次将一些文件上传到一个FTP帐户的多个文件夹中。我一直在寻找如何做到这一点,无法找到解决方案。是否有FTP客户端将执行此功能?

由于

3 个答案:

答案 0 :(得分:1)

这是我在浏览docs后想出的一个教程:

  1. 下载并安装WinSCP并运行
  2. 连接到服务器
  3. 转到菜单>会话>服务器/协议信息
  4. 复制" Server host key指纹" (ssh-rsa 2048 xx:xx:xx:xx..."
  5. 现在创建一个名为upload.txt的文件,添加以下内容(并根据需要进行修改):

    # Connect
    open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx..."
    # Change remote directory
    cd /home/user/public
    # Download file to the local directory d:
    get robots.txt d:\
    # Upload file to current working directory
    put d:\examplefile.txt 
    # Disconnect
    close
    # Exit WinSCP
    exit
    

    接下来使用正确的路径创建批处理文件run.bat

    "C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /script="C:\folder-with-uploadfile\upload.txt"
    pause
    

    运行批处理文件。

    检查exampe文件robots.txt是否已下载到文件夹D:以及examplefile.txt是否在服务器上的示例文件夹中。

    如果是多台服务器:https://winscp.net/eng/docs/script_upload_multiple_servers


    PS:我是FileZilla的长期用户,但到2018年2月他们还没有这个功能。所以为WinSCP +1。

答案 1 :(得分:0)

此功能不是内置于我所知道的任何客户端,甚至也不是FTP协议。

模仿此功能的一个客户端是Cyberduck,具有“同步”功能,允许您使用时间戳将您同步的文件夹上的任何更改上传到FTP服务器。

答案 2 :(得分:0)

您可以使用任何支持目录同步的FTP客户端。

例如,WinSCP:
https://winscp.net/eng/docs/task_synchronize

(我是WinSCP的作者)