Download file from url using CopyUrlToFile action

Learn how to use CopyUrlToFile to effortlessly download files from a URL to a custom location. This page offers source code, build instructions, and a step-by-step guide for creating a trigger to automate file downloads.
  1. Blog

This custom trigger action helps to download a file from a given Url to a custom location. It also helps to download the files easily without any manual effort.

Downloads

Source code and build instructions

How to download a file from a Url using CopyUrlToFile Action 

 Let me now show you how to implement that.

1. Create a Trigger to download the file

Login into admin console of JSCAPE MFT Server > Triggers and Click Add to create a Trigger

Give the trigger a Name and then select the Current Time event type from the drop-down list.

copy_url_to_file

ClickNextto Step 2 where a condition can be set to execute the trigger.

Below screen shows a condition that the trigger should execute at 22 Hours 30 minute . Set the condition as Hour =22 AND Minute 30

Once the condition is set ClickNextto proceed

clam_av_virus_update_img2

The step 3 asks to add an action, Add the action "CopyUrlToFile" from drop down list. If the action not found read the build instructions (Source code and build instructions) .

Click OK to proceed

copy_url_to_file_img2

The Parameters for the action "Get Logs" are;

  • Url 
  • File

As the name indicates, Url  is the path where the file is located in the internet and File is the location where the file to be downloaded. It is also possible to customize the name during download.

For example as below; 

 copy_url_to_file_img3-1

Here Url hasthe value as "https://files.jscape.com/secureftpserver/pub/install.zip"  and File to be as 

"C:\Jscape\installations\Jscape MFT\11.1\install_11.zip."

The above means that the file install.zip will be downloaded as install_11.zip and that is how we can customize the name of the file that gets downloaded.

Click OK to save the settings

That's it. Now you know how to create a trigger to download a file from a Url to Custom location.