Consultor Eletrônico



Kbase P109806: How to transfer files with URL syntax (supporting FTP, FTPS, TFTP, HTTP, HTTPS, GOPHER, TELNET, DICT
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to transfer files with URL syntax (supporting FTP, FTPS, TFTP, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP) onto disc.

FIX:

An easy way of transferring a file with a URL syntax onto a disc file is to use the curl utility.
curl takes a URL as the first parameter, fetches the file from said URL, and copies the file onto the standard input. The usual techniques can be used to redirect the output from curl onto a file, or to pipe its output onto another command.

A sample usage of curl is:

curl http://www.progress.com > ProgressSoftwareHomePage.txt

From within the 4GL, that becomes:

OS-COMMAND "curl http://www.progress.com > ProgressSoftwareHomePage.txt".

curl can be downloaded from http://curl.haxx.se/. Please check their web pages for the availability of curl on the various operating systems.
Please note that Progress Software does not support nor endorse curl. Any problem with curl should be reported to their Technical Support staff at http://curl.haxx.se/support.html.