如何将文件从本地文件夹复制到FTP服务器 [英] How I can copy file from local folder to FTP server

查看:855
本文介绍了如何将文件从本地文件夹复制到FTP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的本地驱动器上有一个文本文件,我想在FTP服务器上复制该文件,如果复制成功则该文件应该移动到另一个名为备份文件夹的文件夹,如果它无法复制的话文件应该移动到同一个驱动器上的错误文件夹,你能帮我解决这个问题吗?



我尝试过:



我试过了,但没办法。因为我只能将文件从本地驱动器复制到FTP服务器,但我无法备份复制文件,所以你能帮我吗

Hi, I have a text file on my local drive and I wanted to copy that file on FTP server, If it copied successfully then the file should move to the another folder called "Backup folder" and if it fails to copy then file should move to "Error Folder" on same drive, Can you help me to get out off this?

What I have tried:

I tried, but it didn't worked. As I am only able to copy file from local drive to FTP server, But I am not able to take backup of copied file, so could you help me

推荐答案

它取决于您使用哪个应用程序通过FTP上传文件。其中一些应用程序可以通过单个命令行调用编写脚本或支持上载。然后从批处理(Windows)或shell(Linux)脚本调用这样的脚本/命令行,检查返回值,并相应地采取行动(移动文件)。



对于 WinSCP ,有以下示例:自动将文件传输(或同步)到FTP服务器或SFTP服务器: :WinSCP [ ^ ]。请参阅最后一节检查脚本结果以获取示例批处理文件,您只需要通过 move sendmail 调用>命令并使用相应的 WinSCP 脚本文件,如该页面所述。
It depends on which application you are using for uploading files via FTP. Some of those applications can be scripted or support uploads with a single command line call. Then call such a script / command line from a batch (Windows) or shell (Linux) script, check the return value, and act accordingly (move file).

For WinSCP this is well documented with examples: Automate file transfers (or synchronization) to FTP server or SFTP server :: WinSCP[^]. See there the last section Checking script results for an example batch file where you only have to replace the sendmail calls by move commands and use an appropriate WinSCP script file as described also on that page.


这篇关于如何将文件从本地文件夹复制到FTP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆