Xceed .NET Libraries Documentation
BeginSendMultipleFiles(String,Boolean,Boolean,AsyncCallback,Object) Method


Xceed.Ftp Assembly > Xceed.Ftp Namespace > AsyncFtpClient Class : BeginSendMultipleFiles(String,Boolean,Boolean,AsyncCallback,Object) Method
The full path and file mask of the local files to send. This parameter can include a filtering mask to limit the files that are sent. For example, if "c:\temp\*" is specified, the entire contents of the "c:\temp" will be sent. If "c:\temp\*.txt" is used, all the files in the "c:\temp" folder that have the TXT extension will be sent. The "temp" folder will not be recreated on the FTP server.
true if the files in child folders should also be sent; false otherwise.
true if the local directory structure should be recreated on the FTP server; false otherwise.
Callback method to be called when the asynchronous operation is completed.
An object containing state information for this operation.
Begins the process of sending the files that match the provided file mask to the FTP server's current working folder. Don't forget to call EndSendMultipleFiles!
Syntax
'Declaration
 
Public Function BeginSendMultipleFiles( _
   ByVal localFileMask As String, _
   ByVal recursive As Boolean, _
   ByVal recreateFolderStructure As Boolean, _
   ByVal callback As AsyncCallback, _
   ByVal state As Object _
) As IAsyncResult
'Usage
 
Dim instance As AsyncFtpClient
Dim localFileMask As String
Dim recursive As Boolean
Dim recreateFolderStructure As Boolean
Dim callback As AsyncCallback
Dim state As Object
Dim value As IAsyncResult
 
value = instance.BeginSendMultipleFiles(localFileMask, recursive, recreateFolderStructure, callback, state)
public IAsyncResult BeginSendMultipleFiles( 
   string localFileMask,
   bool recursive,
   bool recreateFolderStructure,
   AsyncCallback callback,
   object state
)

Parameters

localFileMask
The full path and file mask of the local files to send. This parameter can include a filtering mask to limit the files that are sent. For example, if "c:\temp\*" is specified, the entire contents of the "c:\temp" will be sent. If "c:\temp\*.txt" is used, all the files in the "c:\temp" folder that have the TXT extension will be sent. The "temp" folder will not be recreated on the FTP server.
recursive
true if the files in child folders should also be sent; false otherwise.
recreateFolderStructure
true if the local directory structure should be recreated on the FTP server; false otherwise.
callback
Callback method to be called when the asynchronous operation is completed.
state
An object containing state information for this operation.

Return Value

An System.IAsyncResult representing the status of the asynchronous operation.
Remarks

The files that match the provided file mask will be sent to the current working folder. If you want to send the files to another location, you could use the BeginChangeCurrentFolder%M:Xceed.Ftp.AsyncFtpClient.EndChangeCurrentFolder(System.IAsyncResult)% methods and/or BeginChangeToParentFolder%M:Xceed.Ftp.AsyncFtpClient.EndChangeToParentFolder(System.IAsyncResult)% methods to change the current working folder.

The current working folder can be retrieved via the BeginGetCurrentFolder%M:Xceed.Ftp.AsyncFtpClient.EndGetCurrentFolder(System.IAsyncResult)% methods.

By default, if an error occurs during the multiple-file transfer, the entire operation will be aborted. To change this behavior, the FtpClient.MultipleFileTransferError event must be handled and its Action property set to either Retry or Ignore.

When using a callback, the System.IAsyncResult is provided as a parameter. You should call EndSendMultipleFiles in that callback. When NOT providing a callback, you should keep the returned IAsyncResult and call EndSendMultipleFiles with it when ready to complete. In this later case, the call to EndSendMultipleFiles may block until the operation completes.

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