All,
SSIS - trying to make an ftp connection to upload files to an ftp server using a script task in visual basic programming language, I have run into a problem. I have not found something similar in my searches so I would appreciate your help.
[Connection manager "FTP"] Error: An error occurred in the requested FTP operation. Detailed error description: 220
550 SSL/TLS required on the control channel
CODE:
Public Sub Main()
'
' Add your code here
'
Try
Dim cm As ConnectionManager
cm = Dts.Connections("FTP")
'Set the properties like username & password
cm.Properties("ServerName").SetValue(cm, "ftps.example.com")
cm.Properties("ServerUserName").SetValue(cm, "username")
cm.Properties("ServerPassword").SetValue(cm, "password")
cm.Properties("ServerPort").SetValue(cm, "port")
cm.Properties("Timeout").SetValue(cm, "0") 'The 0 setting will make it not timeout
cm.Properties("ChunkSize").SetValue(cm, "1000") '1000 kb
cm.Properties("Retries").SetValue(cm, "1")
'create the FTP object that sends the files and pass it the connection created above.
Dim ftp As FtpClientConnection = New FtpClientConnection(cm.AcquireConnection(Nothing))
'Connects to the ftp server
ftp.Connect()
'Build a array of all the file names that is going to be FTP'ed (in this case only one file)
Dim files(0) As String
files(0) = "C:\ local path file"
'ftp the file
ftp.SendFiles(files, "/remote path", True, False) ' the True makes it overwrite existing file and False is saying that it is not transferring ASCII
ftp.Close()
Catch ex As Exception
Dts.TaskResult = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
End Try