Consultor Eletrônico



Kbase P170653: How can I easily send a file to an FTP server from Windows?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/30/2010
Status: Unverified

GOAL:

How can I easily send a file to an FTP server from Windows?

GOAL:

How can I transfer a file via FTP on Windows using OS-COMMAND?

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

FIX:

The built-in ftp.exe command on Windows provides the ability to use a text file as a list of commands to execute. The following code shows how to create a text file to upload a file to an ftp server. Please note that this is a rather brute force method of doing it and it provides no way to determine if there was a problem. It should be used only in scenarios where the chance of having a problem with the FTP server are virtually nil.

output to ftpcmd.txt.

put unformatted "open your_ftp_hostname_goes_here" skip.
put unformatted "the_user_name_goes_here" skip.
put unformatted "the_password_goes_here" skip.
put unformatted "put_either_bin_or_asc_here_for_binary_or_ascii_file_type" skip.
put unformatted "put file_name_to_transfer_here" skip.
put unformatted "bye" skip.

output close.

os-command ftp -s:ftpcmd.txt.