URL Download File
AutomatR.Web.URLDownloadFile
The "URL Download File" activity in AutomatR is designed for downloading files from a specified URL and saving them to a local disk. This activity is useful for scenarios where files hosted on external servers, such as images or documents, need to be retrieved and stored locally.
Properties
Name | Description |
---|---|
Input | |
URL | Specifies the URL where the file is hosted (e.g., Google Drive). String variables containing the URL. |
Save File Path | Specifies the local path where the downloaded file should be saved. It can include the location and file name (e.g., "D:\test\image.png"). String variables containing the save file path. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "URL Download File" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e. 1. |
Output | |
Result | Outputs the result of the "URL Download File" operation, indicating whether the file was successfully downloaded or encountered any errors. Variables of relevant types (e.g., Boolean variables) to store the operation result. |
How to use:
- Drag and drop the "URL Download File" activity onto the workflow.
- Configure the properties by specifying the URL and the local path where the downloaded file should be saved.
- Optionally, configure the delay.
- Execute the workflow to download the file from the specified URL and save it locally.
Note:
- The activity checks if the provided save file path is a directory. If it is, the activity generates a file name based on the URL. If it's a complete file path, the file is saved with the specified name.
Example: Consider an example where the "URL Download File" activity is used to download an image from a URL and save it to a local folder:
URL Download File:
URL: "https://example.com/images/sample.png"
Save File Path: "D:\Downloads\sample.png"
Result: isDownloadSuccessful
In this example, the activity downloads the image from the specified URL and saves it to the "D:\Downloads" folder with the name "sample.png". The result of the operation (success or failure) is stored in the Boolean variable "isDownloadSuccessful" for further handling in the workflow.