March 22, 2011 at 11:30 am
I have script task that upload a file to https. I have no error when the script task is executed. But the file is not received at https web server.
* I could download a file from https but my file is uploaded. PLease help me out. Here is my script.
Public Sub Main()
'
' Add your code here
'
Dim WebConnection As New WebClient()
Dim connectionString As String
Dim creds As New NetworkCredential("username", password")
connectionString = "https://abc.com/out"
Try
With WebConnection
.BaseAddress = connectionString
.Credentials = creds
End With
Catch ex As Exception
Dts.Events.FireError(0, "Problem connecting to website: ", ex.Message, "", 0)
End Try
Try
With WebConnection
.UploadFile(connectionString, "C:\text.txt")
End With
Catch ex As Exception
Dts.Events.FireError(0, "Problem downloading file: ", ex.Message, "", 0)
End Try
Dts.TaskResult = ScriptResults.Success
End Sub
Is there other ways to upload a file to HTTPS via SSIS?
April 27, 2011 at 8:01 am
This script worked for me, here is what I changed:
Added:
Imports System.Net
and changed the following line:
Dim creds As New NetworkCredential("username", "password")
After I made those changes and put in the appropriate credentials, worked like a charm.
Thanks
April 27, 2011 at 8:41 am
Thank you. I installed WINSCP and called the program from script task. It works for me.
December 9, 2020 at 4:44 pm
Hi All
I am new to SSIS and I need to work on uploading a csv file which contains the records downloaded from a database table.
The size of the csv file comes closed to 40MB. So I need to upload the csv file to REST endpoint with UTF-8 encoding without Byte Order Mark.
Can someone help me with the code that needs to be written in the Script task.
Thanks
Abhijith
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply