Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Data Connection Broken Pipe System.Net.FtpClient

$
0
0

Hi All,

In my SSIS Script I used the code sample below. I used System.Net.FtpClient and added it in GAC.

The issue is When I'm setting a local ftp address like ,ftp://127.0.0.1/testdirectory (Dummy Ftp Created by FileZilla)

then this code block is working perfectly. But when I'm trying to connect some external ftp addresses (not SFTP!!!)

then this code is throwing exception as : 'data connection : broken pipe'

But those ftp addresses I can browse from my windows> run perfectly.

What I'm I doing wrong? what could be the work around?

Basically I'm trying to handle ftp from script because I need to get filesize in FTP and accordingly need to download them.

...

using System.Net.FtpClient;  

....

....

FtpClient conn = new FtpClient();
            
            conn.Host = ServerName; conn.Credentials = new NetworkCredential(ServerUserName, ServerPassword);
            try
            {
                conn.Connect();
                 //Set Working Directory
                 if (conn.DirectoryExists(WorkDirectory))
                 {   
                    conn.SetWorkingDirectory(WorkDirectory);
                    if(conn.FileExists(SourceFileName))
                    {
                        MessageBox.Show("hello");
                    }
                 }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message.ToString());
            }


Regards, Avik M.



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>