Question

I read this article:

The two are very different from each other, although they both aim to serve the same purpose. SFTP uses a single channel to transmit and receive all the pertinent data, while FTPS uses another channel that is dynamically decided for the data. FTPS often had problems when passing through a firewall, as it did not know the port that was being used by the data, and failed to allow traffic through the port. FTPS sends messages in a text format, allowing people to read logs and determine what happened during the session. This is not possible with SFTP, as the messages are not in text, but in binary.

Read more: Difference Between FTPS and SFTP | Difference Between | FTPS vs SFTP http://www.differencebetween.net/technology/internet/difference-between-ftps-and-sftp/#ixzz20KUGWr00

I didn't want to assume anything as this would just make my job harder if I am wrong but when I am sending a file through C#/.Net4 like this:

  var request = (FtpWebRequest) WebRequest.Create(FtpUrl + filename);
    request.Method = WebRequestMethods.Ftp.UploadFile;

    var secureString = new SecureString();
    foreach (var b in Encoding.Default.GetBytes(FtpPassword))
      secureString.AppendChar((char) b);
    request.Credentials = new NetworkCredential(FtpUsername, secureString);
    request.EnableSsl = true;

Is that going SFTP or FTPS? I am assuming FTPS as the article indicates due to the EnableSsl.

If it is not SFTP, can I change this to be SFTP instead? I'm having problems sending through a firewall.

Thanks!

Was it helpful?

Solution

SFTP is uses SSH to transfer the file. You can change it to this if you are running ssh on the remote machine. I'm not sure if C# has support for it though. According to this: http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/817b4f71-7e88-4b62-b48a-8a5edca800fd/ the answer is no.

FTPS is adding SSL onto FTP. Kind of like HTTPS is SSL on top of HTTP.

Your code is definitely using FTPS.

Your firewall issues are probably explained here: http://en.wikipedia.org/wiki/Ftps#Firewall_incompatibilities

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top