-
-
Notifications
You must be signed in to change notification settings - Fork 18
Documentation ARexxAPI GETURL
Jens Maus edited this page Feb 13, 2017
·
1 revision
NAME:: GetURL -- Download a file from the World Wide Web using HTTP. (V2.1)
TEMPLATE:: URL/A,FILENAME/A
FUNCTION:: Downloads a file from the World Wide Web by HTTP and saves it to disk.
INPUTS::
URL/A
- complete URL to the file\
FILENAME/A
- complete filename to write the file to\
RETURNS::
RC
is set to 5 if a TCP/IP stack is not running, or 10 if it is
actually running but not online, if the URL cannot be found, or
if the output filename cannot be written to.
NOTES:: The "!http://" introducer is optional, but otherwise the only one supported.
EXAMPLE:: {{{#!arexx /* Enable result codes */ OPTIONS RESULTS
/* Ignore possible error from GETURL */
OPTIONS FAILAT 11
/* Download a file */
GETURL 'http://yam.ch/files/YAM22.lha' 'RAM:YAM22.lha'
/* Report results */
c = RC
SELECT
WHEN c = 5 THEN SAY 'TCP/IP stack not running.'
WHEN c > 5 THEN SAY 'Error.'
OTHERWISE SAY 'File downloaded successfully.'
END
}}}
BUGS:: The command is interrupted if email is sent or received.
SEE ALSO::