file download ...

Prev Next

Function Names

file download, file download all, file download silently, file download overwrite, file download overwrite all, file download overwrite silently

Description

These functions downloads files from the Internet (URL address) and come in following flavors:
file download will assert an exception if the file cannot be downloaded (e.g. web page not found, etc.) Execution will stop immediately.
file download silently will download the files until a first failure is encountered. In this case, the applicable one of the short error messages on directories and files will be returned. If no errors have been encountered, "OK" will be returned. file download all tries to download all files and skips the ones which cannot be downloaded. Here, the number of successfully downloaded files will be returned.
... overwrite ... in the function name will overwrite existing destination files. Without this name ending, attempting to overwrite existing files assert exceptions.

Call as: procedure or function

Restrictions

Indirect parameter passing is disabled.

OS differences

Windows: If no protocol like http://, https:// or ftp:// is specified, then http:// is added in front of the URL name. No issue appears if the web page ends up to be a https:// page. This is taken care automatically.

Linux, MacOS: The web download is implemented with the wget command

Parameter count

2

Parameters

No.TypeDescription
1
input
set or string Name of existing URL (web address)

Specify web address as seen on the address bar in your browser.

2
input
set or string new path and file names

Destination paths and new file names. The number of URL's specified and of files specified in this function parameter must match..

Return value

TypeDescription
numeral or string Feedback

file download / file download overwrite: Always "OK", because all errors cause exceptions.
file download ... silently: "OK", or short error messages on directories and files.
file download ... all: Number of successful operations (files copied) is returned.

Exceptions

URL not found
File locked by another application
Number of URLs and file names are not equal

Examples

               file download( "https://en.wikipedia.org/wiki/Coffee", Coffee.html"

See also

file copy ... Functions