-
-
Notifications
You must be signed in to change notification settings - Fork 659
FTPS Proxies
Robinicks edited this page Feb 5, 2020
·
19 revisions
-
new FtpClientHttp11Proxy() - Creates a new FTP client to connect using an HTTP 1.1 proxy.
-
new FtpClientUserAtHostProxy() - Creates a new FTP client to connect using a User@Host proxy.
-
new FtpClientBlueCoatProxy() - Creates a new FTP client to connect using the BlueCoat proxy.
Create a new instance of one of the proxy classes and then use any of the available API to control the connection. For example:
// create an FTP client connecting through a HTTP 1.1 Proxy
var proxy = new ProxyInfo(){
Address = new Uri("http://myproxy.com/"),
};
FtpClient client = new FtpClientHttp11Proxy(proxy);
client.Host = "123.123.123.123";
client.Credentials = new NetworkCredential("david", "pass123");
// begin connecting to the server
client.Connect();
// get a list of files and directories in the "/htdocs" folder
foreach (FtpListItem item in client.GetListing("/htdocs")) {
// if this is a file
if (item.Type == FtpFileSystemObjectType.File){
// get the file size
long size = client.GetFileSize(item.FullName);
// calculate a hash for the file on the server side (default algorithm)
FtpHash hash = client.GetHash(item.FullName);
}
// get modified date/time of the file or folder
DateTime time = client.GetModifiedTime(item.FullName);
}
// upload a file
client.UploadFile(@"C:\MyVideo.mp4", "/htdocs/MyVideo.mp4");
// rename the uploaded file
client.Rename("/htdocs/MyVideo.mp4", "/htdocs/MyVideo_2.mp4");
// download the file again
client.DownloadFile(@"C:\MyVideo_2.mp4", "/htdocs/MyVideo_2.mp4");
// delete the file
client.DeleteFile("/htdocs/MyVideo_2.mp4");
// disconnect! good bye!
client.Disconnect();
- Auto Connection
- Auto Reconnection
- FTP(S) Connection
- FTP(S) Connection using GnuTLS
- FTPS Proxies
- Custom Servers
- Custom Commands
- v40 Migration Guide