Introduction
This article provides a concise guide on how to download a file from a URL and save it into a Physical folder location using SSIS. It covers the setup, configuration, and execution of the necessary steps to streamline your data workflows.
Solution
In this article, we demonstrate how to automate the process of loading files from URLs stored in CSV files into a Physical folder location using SQL Server Integration Services (SSIS). We will guide you through reading the URLs from the CSV file using CSV Source, read/downloading the files using a Web API Destination, and finally saving the file to a folder with a FUN_WRITE_FILE_BINARY Placeholder function using a Template Transform.
If you have file URLs in any other source, you can read the file URL from there using the desired source component.
We also have an article that demonstrates how to extract image URLs from a web page and download the images. You can read it How to download images from a web page using SSIS.
Step-by-Step Guide
Let’s jump right in, step by step, as we learn how to download a file from a URL using SSIS.
-
Firstly, You need to Download and Install SSIS ZappySys PowerPack.
-
Once you have finished the first step, Open Visual Studio and Create a New SSIS Package Project.
-
Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox. And double click on the DataFlow task to see DataFlow designer surface.
-
From the SSIS toolbox, drag and drop CSV Source on the dataflow designer surface.
-
Double click CSV Source and configure it like this:
- Set the CSV File Path: In this case, use
FileURLs.csv
. - Select the Desired Column Separator Choose the appropriate column separator.
- Check “First Row Has Column Headers”: Ensure this option is selected.
- Preview the CSV File Data: Click on “Preview” to view the data.
- Close the CSV Source: Click “OK” to close the CSV Source.
- Set the CSV File Path: In this case, use
-
Below the CSV Source, drag and drop the Web API Destination. Configure a new HTTP Connection by setting the dummy Web URL to
https://
then click OK.
-
Set the CSV Source
FileURL
column as the input column for the URL. ChooseGET
as the HTTP Request Method, checkmark “Treat Response as Binary Data”, and then click “OK”.
-
Now let’s save the file into the local folder using Template Transform:
Sample:
Related Articles
- How to download file from URL using SSIS
- How to download files from OneDrive using SSIS
- How to download files from SharePoint Online using SSIS
- How to download files from Google Drive using SSIS
- How to download images from a web page using SSIS
Conclusion
This comprehensive guide should assist you in reading/downloading a file from a URL and loading it into an SQL table using ZappySys components in your SSIS packages. For further assistance, please contact our support team via chat on our website.