2
votes

I am currently trying to send a single file through to an FTP site, using an SSIS FTP task to which it is failing and I'm receiving the error:

[FTP Task] Error: Unable to send files using "FTP Connection Manager".

Using the SSIS FTP Task, I am trying to send a file from a local drive to an FTP root folder. I have all the permissions to read and write. I have tried to delete the file on the FTP server (successful), move the file using WinSCP (successful), delete the file from the FTP folder (successful) as well as create a directory on the FTP site. However, when I try and send from a local folder to the root drive of the FTP site, I get the above-mentioned error. My local path includes the file I am wanting to send as well

C:\WebSites\Files\Import\SFTP\Extract\CE_CS_Shipment.xlsx

Configuration for FTP Task

Is there anything else I can try because I am at my wits ends.

Error

1
Are you sure that the server is FTP and not SFTP or FTPS? SSIS natively only supports plain FTP. If you're already using WinSCP, why not use that to transfer the file?Bacon Bits
It is definitely FTP. Unfortunately I have to use SSIS to do the file transfer after I've processed everything. I was just using WinSCP to ensure that I could connect and transfer files that way.user1397978
SSIS` FTP Task is a wrapper around the command line ftp command which you should use a test. If that fails, your target FTP site has an unconventional setupArthur
Do you know that you can use WinSCP from SSIS?Tab Alleman
I second the WinSCP suggestion. You don't even have to write most of the script, there's a menu option to auto generate a stub. Call WinSCP using Execute Process Task and pass the script property to the arguments. I have a number of SSIS packages working just like this to send data off site.Jacob H

1 Answers

1
votes

I seemed to have found a workaround because using the FTP Task in SSIS just wasn't budging. I created the file on the FTP site, followed by copying the stream and that works perfectly.

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(sftpServer + result);
request.Credentials = new NetworkCredential(sftpUser, strFTPPassword);
request.Method = WebRequestMethods.Ftp.UploadFile;
using (Stream fileStream = File.OpenRead(archiveFolder.Replace("//", "/") + @"/" + result))
using (Stream ftpStream = request.GetRequestStream())
{
     fileStream.CopyTo(ftpStream);
}

This now works perfectly in the event that someone else is looking for or struggling with the same problem.