How to use FTP using Progress 4GL?

跟風遠走 提交于 2020-01-03 07:02:58

问题


Is there any way to send files from a local folder to an FTP folder using Progress?


回答1:


If you're running windows, then WinSCP is a good solution: http://winscp.net/eng/index.php




回答2:


The "classic" way to do this is to send the commands that you would use if you were doing this manually to the built-in FTP command.

If you know that you want to send a file called "myfile.txt" to the server at 192.168.0.1 you might code:

define variable IPAddr   as character no-undo.
define variable fileName as character no-undo.

IPAddr = "192.168.0.1".
fileName = "myfile.txt".

output through value( "ftp -v -i -A" + IPAddr ).

put unformatted "put " + fileName skip.
put unformatted "bye " skip.
output close.

Obviously you can wrap that into a function and expand it to do more than a simple FTP PUT command (you might need to login...)

FTP is an insecure protocol and a PITA to work with. If you have any influence over such things you really ought to try to use a better protocol. SCP is much easier to use and has much better security.




回答3:


DEFINE VARIABLE cFtpCommand AS CHARACTER   NO-UNDO.

cFtpCommand = "your FTP COMMAND".

OS-COMMAND SILENT NO-CONSOLE VALUE(cFtpCommand).


来源:https://stackoverflow.com/questions/29707412/how-to-use-ftp-using-progress-4gl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!