Hi,
FtpWebRequest is a bit unfortunate attempt to mimic HTTP behaviour but connect via FTP protocol. Problem is that HTTP is stateless protocol (connect - send one request - read one response - disconnect), but FTP is session-based protocol (connect - issue several commands - disconnect).
It would be better to use some of third party FTP components which can be found in the wild. Most of them are session-based.
Following code shows how to achieve it with our Rebex FTP/SSL
using Rebex.Net;
// create client and connect
Ftp client = new Ftp();
client.Connect("ftp.example.org");
// authenticate
client.Login("username", "password");
// change the current directory to '/top'
client.ChangeDirectory("/top");
// upload the 'test.zip' file to the current directory at the server
client.PutFile(@"c:\data\test.zip", "test.zip");
// upload the 'index.html' file to the specified directory at the server
client.PutFile(@"c:\data\index.html", "/wwwroot/index.html");
// upload the content of 'c:\data' directory and all subdirectories
// to the '/wwwroot' directory at the server
client.PutFiles(@"c:\data\*", "/wwwroot", FtpBatchTransferOptions.Recursive);
// disconnect
client.Disconnect();
Code is taken from www.rebex.net/ftp-ssl.net/tutorial-ftp.aspx