A built-in function for downloading content (resources) over HTTP(S) via the Tachyon Background channel, or from an external web-server.
If the file cannot be downloaded, or the downloaded content does not match the hash and size supplied, an error occurs and the instruction is terminated.
The file is downloaded into a randomly named sub-directory of TemporaryDirectory. From version 5.1 onwards, the location of TemporaryDirectory is a configuration setting of the 1E Client.
The sub-directory and file is deleted when the instruction ends. If you want to keep the file, make the instruction copy it to a permanent location.
The following table shows the OS-specific defaults used if the setting is omitted, blank, or invalid. The default is recommended.
If 1E Nomad is available, it will optimize the download, storing a local copy of the file in the Nomad cache, with cache priority 1 and is subject to normal Nomad cache management.
It is a runtime error if the status code from a GET request on the full absolute URL is not 200.
When an absolute URL is specified and the schema is 'https' then the endpoint requesting the resource will attempt to verify the entire certificate chain of the resource as normal. This can fail if the endpoint does not recognize all the links in the chain of trust. The rules of checking are more rigorous than some browsers, which are often relaxed about the very root of the chain if it is signed using a sha1 algorithm. This means whilst a browser may download the resource and display it, the endpoint might actually complain about the validity of the root Certificate Authority certificate.
To resolve this, you need to get hold of the public key for the root certificate and:
This is a temporary file that persists only while the instruction is live. When the instruction ends the file will be deleted. If you want to keep the file, make the instruction copy it to a permanent location.
A common use for this function is to download a script which can then be executed locally.
To download content from an external web-server, you can instead set the URL property to the full URL of the file to be downloaded.
Tachyon 3.1 uses a new URL format for retrieving downloaded files. Consequently, 3.1 agents are not fully backwards-compatible with 3.0 servers. They will communicate with them and execute simple instructions, but they will be unable to download content from a 3.0 server.