views:

816

answers:

7

Anyone know of a good, hopefully free FTP class for use in .NET that can actually work behind an HTTP proxy or FTP gateway? The FtpWebRequest stuff in .NET is horrible at best, and I really don't want to roll my own here.

A: 

System.Net.WebClient can handle ftp urls, and it's a bit easier to work with. You can set credentials and proxy information with it, too.

Joel Coehoorn
the man clearly said that isn't an option
DevelopingChris
No, he said FTPWebRequest was not an option. System.Net.WebClient is a different class entirely.
Joel Coehoorn
He changed his question after some answers...
pb
I see upload and download in WebClient but no delete. Is it really possible to delete and rename on a FTP via an HTTP proxy with WebClient?
Jonas Elfström
A: 

I have no particular experience but sharptoolbox offer plenty implementations.

Jakub Šturc
+1  A: 

You can give "Indy.Sockets" a try. It can handle a lot of high level network protocols, including ftp.

Juanma
I use it, but it does have some quirks like leaving behind temp files.
Jonathan Allen
A: 

The best one I've run across is edtFTP.net http://www.enterprisedt.com/products/edtftpnet/overview.html

If offers flexibility you don't get in the built-in classes

Brad Bruce
A: 

I have used http://sourceforge.net/projects/dotnetftpclient/ for quite a while now, and it does the job nicely. If you use a PASV connection, you shouldn't have any firewall issues. Not sure what an FTP gateway is, but I don't see how the HTTP Proxy would affect any FTP connection.

Kearns
dotnetftpclient does not support HTTP proxy.
Jonas Elfström
+1  A: 

Our Rebex FTP works with proxies just fine. Following code shows how to connect to the FTP using HTTP proxy (code is taken from FTP tutorial page).

// initialize FTP client 
Ftp client = new Ftp();

// setup proxy details  
client.Proxy.ProxyType = FtpProxyType.HttpConnect;
client.Proxy.Host = proxyHostname;
client.Proxy.Port = proxyPort;

// add proxy username and password when needed 
client.Proxy.UserName = proxyUsername;
client.Proxy.Password = proxyPassword;

// connect, login 
client.Connect(hostname, port);
client.Login(username, password);

// do some work 
// ... 

// disconnect 
client.Disconnect();

You can download the trial at www.rebex.net/ftp.net/download.aspx

Martin Vobr
+1 for code sample
Jeroen Huinink
A: 

I used this in my project recently and it worked great.

http://www.codeproject.com/KB/IP/ftplib.aspxt

rushonerok