ZennoLab Assemblies Documentation
FtpUploadDirectory Method
See Also  Example Send Feedback
ZennoLab.CommandCenter Assembly > ZennoLab.CommandCenter Namespace > ZennoPoster Class : FtpUploadDirectory Method
host

Type: System.String

The address of the FTP server.
port

Type: System.Int32

The port of the FTP server.

protocol

Type: System.String

The FTP protocol. It can be "FTP", "sFTP", or "FTPs".

login

Type: System.String

The login of the FTP server.

pass

Type: System.String

The password of the FTP server.

proxy

Type: System.String

The proxy string in format: login:pass@ip:port OR ip:port.

serverPath

Type: System.String

The destination path.

localPath

Type: System.String

The path to the file.

recursive

Type: System.Boolean

The true for uploading all subdirectories, and files in localPath; otherwise, false.

uncludeRootName

Type: System.Boolean

The true for include root directory name; otherwise, false.

Glossary Item Box

Uploads the specified directory.

Syntax

C# 
public static void FtpUploadDirectory( 
   string host,
   int port,
   string protocol,
   string login,
   string pass,
   string proxy,
   string serverPath,
   string localPath,
   bool recursive,
   bool uncludeRootName
)

Parameters

host

Type: System.String

The address of the FTP server.
port

Type: System.Int32

The port of the FTP server.

protocol

Type: System.String

The FTP protocol. It can be "FTP", "sFTP", or "FTPs".

login

Type: System.String

The login of the FTP server.

pass

Type: System.String

The password of the FTP server.

proxy

Type: System.String

The proxy string in format: login:pass@ip:port OR ip:port.

serverPath

Type: System.String

The destination path.

localPath

Type: System.String

The path to the file.

recursive

Type: System.Boolean

The true for uploading all subdirectories, and files in localPath; otherwise, false.

uncludeRootName

Type: System.Boolean

The true for include root directory name; otherwise, false.

Remarks

This method uploads directory and overwrite all exit items.

Example

The following example shows call the FtpUploadDirectory method.
C#Copy Code
// upload all items from local directory to the directory with same name on ftp server
ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
 
// upload all items from local directory to the with path "ftp_path"
ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);
PHPCopy Code
// upload all items from local directory to the directory with same name on ftp server
ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
 
// upload all items from local directory to the with path "ftp_path"
ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Reference

ZennoPoster Class
ZennoPoster Members
FtpUploadFile Method

© 2013 All Rights Reserved.