FtpClientConnection.SendFiles(String[], String, Boolean, Boolean) Method

Definition

Sends files to the File Transfer Protocol (FTP) server.

public:
 void SendFiles(cli::array <System::String ^> ^ localFileNames, System::String ^ remotePath, bool overwrite, bool isTransferAscii);
public void SendFiles (string[] localFileNames, string remotePath, bool overwrite, bool isTransferAscii);
member this.SendFiles : string[] * string * bool * bool -> unit
Public Sub SendFiles (localFileNames As String(), remotePath As String, overwrite As Boolean, isTransferAscii As Boolean)

Parameters

localFileNames
String[]

The files on the FTP server to send.

remotePath
String

The remote path where the files are located.

overwrite
Boolean

Specifies whether to overwrite the files, if the files already exist on the remote computer. A value of true indicates that the task will overwrite existing files.

isTransferAscii
Boolean

Specifies if files should be sent in ASCII mode. A value of true indicates that the files should be sent in ASCII mode.

Examples

The following code example shows how to use the SendFiles method.

Package pkg = new Package();  
Connections conns = pkg.Connections;  
ConnectionManager cm = conns.Add("FTP");  
//...  
FtpClientConnection myftpClientConn = new FtpClientConnection(cm);  
String[] localFileNames = { "myTestFile", "myFTPFile" };  
String remotePath = @"\\myserver\myFolder";  
myftpClientConn.SendFiles(localFileNames, remotePath, true, false);  
Dim pkg As New Package()  
Dim conns As Connections = pkg.Connections  
Dim cm As ConnectionManager = conns.Add("FTP")  
'...  
Dim myftpClientConn As New FtpClientConnection(cm)  
Dim localFileNames() As String = {"myTestFile", "myFTPFile"}  
Dim remotePath As String = "\\myserver\myFolder"  
myftpClientConn.SendFiles(localFileNames, remotePath, True, False)  

Applies to