Skip to main content
Roberty Studio
RPAUtils

Download files in batch

Download files in batch

Downloads several files from a list of URLs, saving them to a destination folder. The downloads run in parallel, making the process more efficient. Failures on individual files do not stop the others — the results are consolidated in the action's returns.


Options​

Target folder​

Full path of the folder the files will be saved to, for example C:\Downloads\Lote.

Create destination folder if doesn't exist?​

Defines whether the destination folder is created automatically when it does not exist. Select Yes to create it; otherwise the action fails when the folder is missing.

Files list​

List of files to download. Each item of the list represents one file and must hold the following fields:

Download URL​

URL address of the file to download.

Name to save the file under​

Name the file will be saved under in the destination folder, including the extension, for example relatorio.pdf.

Returns​

Javascript code​

js
actions["action-id"].errorsByFile // map with detailed errors by file name (Any)
actions["action-id"].allFilesDownloaded // whether every file was downloaded successfully (Boolean)
actions["action-id"].filesWithSuccess // list with the names of the files downloaded successfully (List)
actions["action-id"].filesWithError // list with the names of the files that failed (List)

Field selection​

  • errorsByFile — map with detailed errors by file name (Any)
  • allFilesDownloaded — whether every file was downloaded successfully (Boolean)
  • filesWithSuccess — list with the names of the files downloaded successfully (List)
  • filesWithError — list with the names of the files that failed (List)

Rules and Conditions​

  • The Target folder field is required.
  • The list must hold at least one file, and each item must have its URL and name filled in.
  • Failures on individual files do not stop the download of the others.
  • If a file with the same name already exists in the target folder, it is not overwritten: the file is reported in filesWithError with the ALREADY_EXISTS error.