Xceed .NET Libraries Documentation
BeginGetUploadStream Method
Example 


Xceed.Ftp Assembly > Xceed.Ftp Namespace > AsyncFtpClient Class : BeginGetUploadStream Method
Begins the process of retrieving a direct access to the write-only data stream to send to.
Begins the process of retrieving a direct access to the write-only data stream to send to.
Overload List
OverloadDescription
Begins the process of retrieving a direct access to the write-only data stream to send to.  
Begins the process of retrieving a direct access to the write-only data stream to send to, indicating if existing data should be overwritten or appended to.  
Example
AsyncFtpClient ftp = new AsyncFtpClient();
IAsyncResult result = ftp.BeginConnect( "ftp.server.com", null, null );

while( !result.IsCompleted )
  Application.DoEvents();

ftp.EndConnect( result );

result = ftp.BeginLogin( null, null );

while( !result.IsCompleted )
  Application.DoEvents();

ftp.EndLogin( result );

result = ftp.BeginGetUploadStream( "test.txt", true, null, null );

while( !result.IsCompleted )
  Application.DoEvents();

using( System.IO.Stream stream = ftp.EndGetUploadStream( result ) )
{
  byte[] buffer = System.Text.Encoding.ASCII.GetBytes( "Text written to Ftp in a stream" );
  stream.Write( buffer, 0, buffer.Length );
}

return;
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AsyncFtpClient Class
AsyncFtpClient Members