Introduction
In this post we will see how to download file from URL using SSIS REST API Task. If you want to call REST API rather than download file then check this article.
Basically you can download file from URL using two different tasks.
SSIS Download File Task offers simple way to download file without advanced settings (e.g. Specify OAuth Credentials, Headers, Body, Content Type etc)
SSIS REST API Task offers much robust way to download including specify OAuth credentials, Basic Credentials, Headers, Body, Change SSL/TLS Protocol version, Specify Proxy, Error Retry Settings etc.
Prerequisites
Before we download file from URL using SSIS , you will need to make sure following prerequisites are met.
- SSIS designer installed. Sometimes it is referred as BIDS or SSDT (download it from Microsoft site).
- Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.
- Make sure SSIS PowerPack is installed. Click here to download.
Method-1 (Preferred): Download file from URL using REST API Task
Download from Public Page (No Login required)
- Create new SSIS Package and open designer
- Drag ZS REST API Task from SSIS Toolbox (Control Flow)
- Double click it to edit
- Enter the following URL
1https://zappysys.com/downloads/files/nw.zip - Now go to Response Settings Tab
- Check Save Response Content option
- Select Save Mode = Save to file
- Specify target file path (e.g. c:\ssis\nw.zip )
- Check Treat response as binary option. This option must be checked if file is binary format (e.g. image, mp3, avi, zip)
- Click OK to save and Execute SSIS Package.
Using Credentials to download from Secure Page
There will be a time when you have to download from a secure page which requires some sort of Authentication information. REST API Task Support Download URL From Connection option. You can use HTTP Connection or OAuth Connection
Method-2: Download file from URL using Download File Task
- Create new SSIS Package and open designer
- Drag ZS Download File Task from SSIS Toolbox (Control Flow)
- Double click it to edit
- Change Url Access Mode to Direct
- Enter the following URL
1https://zappysys.com/downloads/files/nw.zip - In the target set target file path (e.g. c:\ssis\nw.zip )
- Click OK to save and Execute SSIS Package.