How to download file from URL using SSIS

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.

  1. SSIS designer installed. Sometimes it is referred as BIDS or SSDT (download it from Microsoft site).
  2. Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.
  3. 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)

  1. Create new SSIS Package and open designer
  2. Drag ZS REST API Task from SSIS Toolbox (Control Flow)
  3. Double click it to edit
  4. Enter the following URL
    SSIS REST API Task - Download File from URL (Request Settings)

    SSIS REST API Task – Download File from URL (Request Settings)

  5. Now go to Response Settings Tab
  6. Check Save Response Content option
  7. Select Save Mode = Save to file
  8. Specify target file path (e.g. c:\ssis\nw.zip )
  9. Check Treat response as binary option. This option must be checked if file is binary format (e.g. image, mp3, avi, zip)
    SSIS REST API Task - Download Zip File from URL (Response Settings)

    SSIS REST API Task – Download Zip File from URL (Response Settings)

  10. 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

Using HTTP Connection in SSIS REST API Task to Download Files or Other Data

Using HTTP Connection in SSIS REST API Task to Download Files or Other Data

Method-2: Download file from URL using Download File Task

  1. Create new SSIS Package and open designer
  2. Drag ZS Download File Task from SSIS Toolbox (Control Flow)
  3. Double click it to edit
  4. Change Url Access Mode to Direct
  5. Enter the following URL
  6. In the target set target file path (e.g. c:\ssis\nw.zip )
  7. Click OK to save and Execute SSIS Package.
    SSIS Download File Task - Download File from URL

    SSIS Download File Task – Download File from URL

Posted in SSIS Download File Task, SSIS REST API Task.