问题
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