update docs for WebGetEx.md

Homes32
2024-12-23 09:10:22 -06:00
parent e92ebf7acf
commit 9e23f41f37

@@ -9,7 +9,7 @@ Unless you require the extended functionality it is recommended to use the nativ
## Syntax ## Syntax
```pebakery ```pebakery
WebGet,<URL>,<DestPath>[,<HashType>=<HashDigest>][,Referer=<URL>][,TimeOut=<Int>][,UserAgent=<Agent>][,NOERR] WebGet,<URL>,<DestPath>[,<HashType>=<HashDigest>][,Referer=<URL>][,TimeOut=<Int>][,UserAgent=<Agent>][,FTP-User=][,FTP-Password=][,FTP-Type=][,FTP-Passive=][,NOERR]
``` ```
### Arguments ### Arguments
@@ -18,7 +18,7 @@ Optional arguments may be specified in any order.
| Argument | Description | | Argument | Description |
| --- | --- | | --- | --- |
| URL | URL of the file to download. Supported URI's are `HTTP`, `HTTPS`. | | URL | URL of the file to download. Valid URI's are `HTTP`, `HTTPS`, `FTP`, `SFTP`. |
| DestPath | The full path where the downloaded file will be saved. If the path does not exist it will be created. If the file exists it will be overwritten. | | DestPath | The full path where the downloaded file will be saved. If the path does not exist it will be created. If the file exists it will be overwritten. |
| Hash Verification | **(Optional)** Downloads can be verified by validating the hash value of the downloaded file in the form of `<HashType>=<HashDigest>`. | | Hash Verification | **(Optional)** Downloads can be verified by validating the hash value of the downloaded file in the form of `<HashType>=<HashDigest>`. |
| | HashType= - Hash type to calculate. Supported hash types: `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`. | | | HashType= - Hash type to calculate. Supported hash types: `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`. |
@@ -26,6 +26,10 @@ Optional arguments may be specified in any order.
| Referer= | **(Optional)** Set an http referrer (Referer). | | Referer= | **(Optional)** Set an http referrer (Referer). |
| TimeOut= | **(Optional)** The time-span (in seconds) to wait for a response before the request times out. **Default:** 10 | | TimeOut= | **(Optional)** The time-span (in seconds) to wait for a response before the request times out. **Default:** 10 |
| UserAgent= | **(Optional)** Set a custom User-Agent string used to identify PEBakery to the website. | | UserAgent= | **(Optional)** Set a custom User-Agent string used to identify PEBakery to the website. |
| FTP-User= | **(Optional)** Set the FTP/SFTP user. Default: `anonymous`. |
| FTP-Password= | **(Optional)** Set the FTP/SFTP password. Default: `PhoenixPE`. |
| FTP-Passive= | **(Optional)** Use passive mode in FTP. Default: `true`. This option is ignored for SFTP transfers. |
| FTP-Type= | **(Optional)** Set the FTP transfer type. Supported values are: `binary` or `ascii`. Default: `binary`. This option is ignored for SFTP transfers. |
### Flags ### Flags
@@ -62,11 +66,17 @@ The WebGet User-Agent is resolved in the following order:
```pebakery ```pebakery
// zlib source code will be downloaded to %BaseDir%\zlib.tar.gz. // zlib source code will be downloaded to %BaseDir%\zlib.tar.gz.
WebGetEx,"https://zlib.net/zlib-1.2.11.tar.gz",%BaseDir%\zlib.tar.gz WebGetEx,"https://zlib.net/zlib-1.2.11.tar.gz","%BaseDir%\zlib.tar.gz"
// Downloaded tar.gz file will be validated with its SHA256 digest. // Downloaded tar.gz file will be validated with its SHA256 digest.
WebGetEx,"https://zlib.net/zlib-1.2.11.tar.gz",%BaseDir%\zlib.tar.gz,SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 WebGetEx,"https://zlib.net/zlib-1.2.11.tar.gz","%BaseDir%\zlib.tar.gz",SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
// Download zlib.tar.gz and specify timout and referer // Download zlib.tar.gz and specify timout and referer
WebGetEx,"https://zlib.net/zlib-1.2.11.tar.gz",%BaseDir%\zlib.tar.gz,Referer=https://www.google.com,Timeout=30 WebGetEx,"https://zlib.net/zlib-1.2.11.tar.gz","%BaseDir%\zlib.tar.gz",Referer=https://www.google.com,Timeout=30
// Download from a SFTP server with Username/Password
WebgetEx,"sftp://zlib.net/zlib-1.2.11.tar.gz","%BaseDir%\zlib.tar.gz","FTP-User=TestUser","FTP-Password=Passw0rd"
// Download from an anonymous FTP server
WebgetEx,"ftp://zlib.net/zlib-1.2.11.tar.gz","%BaseDir%\zlib.tar.gz"
``` ```