Command - Download File(s)
The Download command downloads one or more files from the remote server to a folder on the VisualCron Server or on a network share. It can include subfolders. The files are selected on the Remote File filter tab; see Remote File Filter.
The Task output lists the downloaded files. When no file has been downloaded, the command raises the "No file(s) downloaded" error. Whether this error fails the Task is set on the On error tab; see Task - On Error.
The list of downloaded files and the "No file(s) downloaded" error cover the whole Task, not each command. When an earlier Download command of the same Task downloaded files, a later Download command that downloads nothing does not raise the error, and its output lists the files of the earlier command again. To check each download, put each Download command in its own Task.
Download tab

- Delete source file after copy (Source group): when selected, each file is deleted from the remote server after the command has handled it; cleared by default
The remote file is deleted even when it was not downloaded: when an Overwrite options setting skipped it, and when the download still failed after the last Resume if transfer failed try. To delete only files that were downloaded, use this option only with "Overwrite - always if existing", and with Resume if transfer failed cleared. On SCP Connections, the file is deleted with rm -rf, as described on Command - Delete Files.
-
Use raw listing fallback: saved with the command but not used when the command runs, so selecting it does not change how files are listed; cleared by default
-
Destination folder (Destination group): the local folder to save the files in, on the VisualCron Server or on a network share given as a UNC path
For a network share, select a Credential on the Main settings tab. The folder is created if it does not exist. The field is required.
-
Download file mask: the name to save each file under
It is not a filter: it is applied to the name of every downloaded file.
*keeps the remote file name and is the default. Wildcards change part of the name, for example*.bak. To choose which files to download, use the Remote File filter tab.
A mask without wildcards gives every downloaded file the same local name, so each file overwrites the one before it.
-
Overwrite options: what happens when a file with the same name already exists in the Destination folder
- "Overwrite - always if existing" (default): replaces the local file
- "Overwrite - if newer": replaces the local file only if the remote file is newer
- "Overwrite - if destination size is": replaces the local file depending on the size condition in the list next to it
- "Append if destination is smaller - otherwise overwrite": if the local file is smaller, adds to it; otherwise replaces it
- "Append if destination is smaller - otherwise overwrite if newer": if the local file is smaller, adds to it; otherwise replaces it only if the remote file is newer
- "Append if destination is smaller - otherwise skip": if the local file is smaller, adds to it; otherwise skips the file
- "Append if existing - otherwise create": adds the whole remote file to the end of the local file, or creates the local file if it does not exist
- "Append if existing - otherwise skip": adds the whole remote file to the end of the local file; a file that does not exist locally is skipped on FTP and FTPS Connections and downloaded on SFTP and SCP Connections
- "Do not overwrite if existing": keeps the local file and skips the remote file
With "Overwrite - if newer", FTP and FTPS Connections compare the created date of the remote file, as the server lists it, with the modified date of the local file. SFTP and SCP Connections compare the modified dates.
The three "Append if destination is smaller" options add to the local file in different ways. On FTP and FTPS Connections, only the part of the remote file that is missing from the local file is downloaded and added. On SFTP and SCP Connections, the whole remote file is added to the end of the local file, so the local file then holds its old content followed by the complete remote file. On SFTP and SCP Connections, use "Overwrite - always if existing" to replace a partly downloaded file.
-
Size condition (the list next to Overwrite options): available only when Overwrite options is "Overwrite - if destination size is"
The size of the existing local file is compared with the remote file:
- "Larger": downloads when the local file is larger
- "Smaller": downloads when the local file is smaller
- "Same": downloads when the sizes are the same
- "Smaller or larger": downloads when the sizes differ
- "Different": never downloads; to download when the sizes differ, select "Smaller or larger"
The default is "Smaller".
-
Resume if transfer failed. Try resuming: tries a failed download again
Set how many times to try and the interval in seconds between tries. The defaults are "3" times and "1" second; each can be set from "1" to "10000". Cleared by default.
How the retry works depends on the protocol:
- FTP and FTPS: the download continues from where it stopped, but only when Download file mask is
*and the file is in the current folder of the Connection; otherwise the file is not tried again and is skipped - SFTP: the whole remote file is downloaded again and added to the end of what the failed try had written
- SCP: the download is not tried again; VisualCron waits for the set number of tries, then skips the file
- FTP and FTPS: the download continues from where it stopped, but only when Download file mask is
With this option selected, a file that still fails after the last try is skipped without an error, and the command continues with the next file. On SCP Connections this happens to every failed file. On SFTP Connections, a file that failed partway holds the part from the failed try followed by the complete file. If Delete source file after copy is also selected, the remote file is deleted. On SFTP and SCP Connections, leave this option cleared, so that a failed download fails the command. On FTP and FTPS Connections, check the Task output, which lists the downloaded files.
-
Keep modified/created date: sets the dates of the downloaded file to those of the remote file; cleared by default
-
Replace unsupported characters with character: replaces each character in a remote file name that Windows does not allow in file names with the character in the box
Selected by default, and the default character is "c".
-
Save files to destination folder: every file is saved directly in the Destination folder, whatever subfolder it came from
-
Save files to destination relative to source path (default): the subfolders below the source folder of the Remote File filter tab are recreated in the Destination folder
For example, with the source folder
/ftp/downloadand the Destination folderc:\test, the file/ftp/download/subfolder/filenameis saved asc:\test\subfolder\filename. -
Save files to destination with full relative path: the full remote path is recreated in the Destination folder
In the same example, the file is saved as
c:\test\ftp\download\subfolder\filename. -
Override transfer type set in Connection (Transfer type group): FTP and FTPS Connections only
When selected, the transfer type selected in the list, "ASCII" or "Binary", is used for this command instead of the one set in the Connection. The default is "Binary". On SFTP and SCP Connections, the transfer type set in the Connection is used. See Connection - FTP.
-
Maximum number of threads (Threading group): can be set from "1" to "8"; the default is "1"
This setting is saved with the command but is not used when the command runs, and neither is Maximum number of threads (download) on the Connection: files are downloaded one at a time.
-
Credential (Main settings tab): the Credential that VisualCron uses to write the downloaded files when the Destination folder is on a network share that the VisualCron Server's account cannot write to
See Global - Credentials.