Command: download

Syntax

download <url> {,<file> | <dir> }

Description

Downloads (fetches) a file across the internet. Currently, only the HTTP protocol is supported. This command is also available under the name httpget. It effectively performs an HTTP GET operation.

A successful URL retrieval will set the system numeric found to 1. An error will set it to 0.

Note: If the web-server from which the download is being made has authorization checks involving the completion of a web-page, e.g. a login page, then this will not be processed like a browser. Such cases will have the effect of merely downloading the login page, instead of the requested file.

Parameters

Switches

Examples

Download a file index.htm into the local directory. Time out after 10 seconds wait.

download //remotenode/index.htm,-tim=10

Download into the local directory and record the http header.

string header[] ;# Not strictly necessary
download //remotenode/index.htm, -os=header

Download into a specified directory.

mkdir /tmp/cache
download //remotenode/index.htm, /tmp/cache

Download into a specified file, i.e. download and rename.

download //remotenode/yourfile.dat, /tmp/cache/myfile.dat

Download a whole set of image files, and print confirmation.

cd c:/HolidaySnaps
for i=1,50 {
    download //snaps.com/holiday/^(i).jpg
    tell '^(i).jpg downloaded'
}

See Also

Commands:

httppost, httpset