News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Secure FTP  
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.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.