...
Function | HttpGetFile | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Action |
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.
| |||||||||||||||||||||
Parameters |
It is a runtime error if the status code from a GET request on the full absolute URL is not 200.
| |||||||||||||||||||||
| ||||||||||||||||||||||
Size (integer) : The size of the file in bytes. If the downloaded file's size does not match this, a runtime error occurs. | ||||||||||||||||||||||
| ||||||||||||||||||||||
| ||||||||||||||||||||||
PreserveName (boolean, optional, default:false) [Introduced in v3.4]: If false the directory will be the system temporary setting and the filename will be random. If true then directory will be some unique space for the execution of the containing instruction and the stem and suffix in the URL parameter are used as the filename. Cannot be used with the Suffix parameter. | ||||||||||||||||||||||
Return values |
| |||||||||||||||||||||
Example | 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.
| |||||||||||||||||||||
Platforms |
| |||||||||||||||||||||
Notes |
|
...