|Version 2 (modified by AmigaPhil, 3 years ago) (diff)|
GetURL -- Download a file from the World Wide Web using HTTP. (V2.1)
Downloads a file from the World Wide Web by HTTP and saves it to disk.
URL/A - complete URL to the file
FILENAME/A - complete filename to write the file to
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.
The "http://" introducer is optional, but otherwise the only one supported.
/* Enable result codes */
/* 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
WHEN c = 5 THEN SAY 'TCP/IP stack not running.'
WHEN c > 5 THEN SAY 'Error.'
OTHERWISE SAY 'File downloaded successfully.'
The command is interrupted if email is sent or received.