I am a novice with secure FTP. I am developing a Windows application in VS-2008 with framework 3.5 and need to download and upload files. From what I am told is this will be to/from an SSH FTP server running on either port 21 or 22 -- can't recall right now.

I'll need to get file size so I can compare it to the downloaded file's size unless there is a better way to do it.

I understand that there is a login and password for the FTP site and that I will need to supply a public key (private key?) supplied to me by the site administrator.

I need to know which package would be best to download and later purchase. I would like to keep this as simple as possible

Any advice would be most appreciated.

Carl Mitchell GasAmerica Services carl.mitchell@gasamerica.com.

asked 10 Mar '10, 18:52

Carl%20Mitchell's gravatar image

Carl Mitchell
261
accept rate: 0%

edited 10 Aug '10, 13:34

Rebex%20KB's gravatar image

Rebex KB ♦♦
256312


Hello,

To understand the differences between FTPS and SFTP protocols please visit our Secure FTP disambiguation page. FTPS is supported by Rebex FTP/SSL component, SFTP is suported by Rebex SFTP component. Both feature a similar API and are also available as a bundle - Rebex File Transfer Pack

How to connect and login using the Ftp or Sftp class respectively is described in the FTPS tutorial or SFTP tutorial respectively.

How to authenticate with a client certificate using the Ftp class is described in the FTPS tutorial How to authenticate with a public key using the Sftp class is described in the SFTP tutorial

This is how to get file length of the remote file using Ftp class:

Ftp client = new Ftp();
// ... connect and login ... 
// get file length
long fileLength = client.GetFileLength(remotePath);

This is how to get file length of the remote file using Sftp class:

Sftp client = new Sftp();
// ... connect and login ...
// get file info
SftpItem item = client.GetInfo(remotePath);
// get file length
long fileLength = item.Size;
link

answered 11 Mar '10, 14:35

Lukas%20Matyska's gravatar image

Lukas Matyska ♦♦
78217
accept rate: 27%

edited 11 Mar '10, 14:56

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×136
×115
×39
×2

Asked: 10 Mar '10, 18:52

Seen: 434 times

Last updated: 10 Aug '10, 13:34