by JungleJoe posted on 2005/07/05 |
|
Totally new to this area! I'm unsure how to do a secure FTP file transfer. I've created a secure connection and have the stream - but when I execute the following code no file is transferred. Looking at non-secure FTP transfers they send the STOR command first.
SecureNetworkStream stream = tcp.GetStream () ;
System.IO.FileStream input = new System.IO.FileStream (@"c:\test.txt",System.IO.FileMode.Open);
while ((bytes = input.Read (buffer,0,buffer.Length)) > 0)
{
stream.Write (buffer, bytes, 0);
}
input.Close() ;
stream.Flush () ;
stream.Close () ;
What am I doing wrong?
Many thanks. |