Table of Contents

Interface IFtpClient

Namespace
FluentFTP
Assembly
FluentFTP.dll

Interface for the FtpClient class. For detailed documentation of the methods, please see the FtpClient class or check the Wiki on the FluentFTP Github project.

public interface IFtpClient : IDisposable, IBaseFtpClient
Inherited Members
Extension Methods

Methods

AutoConnect()

FtpProfile AutoConnect()

Returns

FtpProfile

AutoDetect(FtpAutoDetectConfig)

List<FtpProfile> AutoDetect(FtpAutoDetectConfig config)

Parameters

config FtpAutoDetectConfig

Returns

List<FtpProfile>

AutoDetect(bool, bool)

List<FtpProfile> AutoDetect(bool firstOnly, bool cloneConnection = true)

Parameters

firstOnly bool
cloneConnection bool

Returns

List<FtpProfile>

Chmod(string, FtpPermission, FtpPermission, FtpPermission)

void Chmod(string path, FtpPermission owner, FtpPermission group, FtpPermission other)

Parameters

path string
owner FtpPermission
group FtpPermission
other FtpPermission

Chmod(string, int)

void Chmod(string path, int permissions)

Parameters

path string
permissions int

CompareFile(string, string, FtpCompareOption)

FtpCompareResult CompareFile(string localPath, string remotePath, FtpCompareOption options = FtpCompareOption.Auto)

Parameters

localPath string
remotePath string
options FtpCompareOption

Returns

FtpCompareResult

Connect()

void Connect()

Connect(FtpProfile)

void Connect(FtpProfile profile)

Parameters

profile FtpProfile

Connect(bool)

void Connect(bool reConnect)

Parameters

reConnect bool

CreateDirectory(string)

bool CreateDirectory(string path)

Parameters

path string

Returns

bool

CreateDirectory(string, bool)

bool CreateDirectory(string path, bool force)

Parameters

path string
force bool

Returns

bool

DeleteDirectory(string)

void DeleteDirectory(string path)

Parameters

path string

DeleteDirectory(string, FtpListOption)

void DeleteDirectory(string path, FtpListOption options)

Parameters

path string
options FtpListOption

DeleteFile(string)

void DeleteFile(string path)

Parameters

path string

DirectoryExists(string)

bool DirectoryExists(string path)

Parameters

path string

Returns

bool

DisableUTF8()

void DisableUTF8()

Disconnect()

void Disconnect()

DownloadBytes(out byte[], string, long, Action<FtpProgress>, long)

bool DownloadBytes(out byte[] outBytes, string remotePath, long restartPosition = 0, Action<FtpProgress> progress = null, long stopPosition = 0)

Parameters

outBytes byte[]
remotePath string
restartPosition long
progress Action<FtpProgress>
stopPosition long

Returns

bool

DownloadDirectory(string, string, FtpFolderSyncMode, FtpLocalExists, FtpVerify, List<FtpRule>, Action<FtpProgress>)

List<FtpResult> DownloadDirectory(string localFolder, string remoteFolder, FtpFolderSyncMode mode = FtpFolderSyncMode.Update, FtpLocalExists existsMode = FtpLocalExists.Skip, FtpVerify verifyOptions = FtpVerify.None, List<FtpRule> rules = null, Action<FtpProgress> progress = null)

Parameters

localFolder string
remoteFolder string
mode FtpFolderSyncMode
existsMode FtpLocalExists
verifyOptions FtpVerify
rules List<FtpRule>
progress Action<FtpProgress>

Returns

List<FtpResult>

DownloadFile(string, string, FtpLocalExists, FtpVerify, Action<FtpProgress>)

FtpStatus DownloadFile(string localPath, string remotePath, FtpLocalExists existsMode = FtpLocalExists.Overwrite, FtpVerify verifyOptions = FtpVerify.None, Action<FtpProgress> progress = null)

Parameters

localPath string
remotePath string
existsMode FtpLocalExists
verifyOptions FtpVerify
progress Action<FtpProgress>

Returns

FtpStatus

DownloadFiles(string, IEnumerable<string>, FtpLocalExists, FtpVerify, FtpError, Action<FtpProgress>, List<FtpRule>)

List<FtpResult> DownloadFiles(string localDir, IEnumerable<string> remotePaths, FtpLocalExists existsMode = FtpLocalExists.Overwrite, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None, Action<FtpProgress> progress = null, List<FtpRule> rules = null)

Parameters

localDir string
remotePaths IEnumerable<string>
existsMode FtpLocalExists
verifyOptions FtpVerify
errorHandling FtpError
progress Action<FtpProgress>
rules List<FtpRule>

Returns

List<FtpResult>

DownloadStream(Stream, string, long, Action<FtpProgress>, long)

bool DownloadStream(Stream outStream, string remotePath, long restartPosition = 0, Action<FtpProgress> progress = null, long stopPosition = 0)

Parameters

outStream Stream
remotePath string
restartPosition long
progress Action<FtpProgress>
stopPosition long

Returns

bool

DownloadUriBytes(out byte[], string, Action<FtpProgress>)

bool DownloadUriBytes(out byte[] outBytes, string uri, Action<FtpProgress> progress = null)

Parameters

outBytes byte[]
uri string
progress Action<FtpProgress>

Returns

bool

EmptyDirectory(string)

void EmptyDirectory(string path)

Parameters

path string

EmptyDirectory(string, FtpListOption)

void EmptyDirectory(string path, FtpListOption options)

Parameters

path string
options FtpListOption

Execute(string)

FtpReply Execute(string command)

Parameters

command string

Returns

FtpReply

ExecuteDownloadText(string)

List<string> ExecuteDownloadText(string command)

Parameters

command string

Returns

List<string>

FileExists(string)

bool FileExists(string path)

Parameters

path string

Returns

bool

GetChecksum(string, FtpHashAlgorithm)

FtpHash GetChecksum(string path, FtpHashAlgorithm algorithm = FtpHashAlgorithm.NONE)

Parameters

path string
algorithm FtpHashAlgorithm

Returns

FtpHash

GetChmod(string)

int GetChmod(string path)

Parameters

path string

Returns

int

GetFilePermissions(string)

FtpListItem GetFilePermissions(string path)

Parameters

path string

Returns

FtpListItem

GetFileSize(string, long)

long GetFileSize(string path, long defaultValue = -1)

Parameters

path string
defaultValue long

Returns

long

GetListing()

FtpListItem[] GetListing()

Returns

FtpListItem[]

GetListing(string)

FtpListItem[] GetListing(string path)

Parameters

path string

Returns

FtpListItem[]

GetListing(string, FtpListOption)

FtpListItem[] GetListing(string path, FtpListOption options)

Parameters

path string
options FtpListOption

Returns

FtpListItem[]

GetModifiedTime(string)

DateTime GetModifiedTime(string path)

Parameters

path string

Returns

DateTime

GetNameListing()

string[] GetNameListing()

Returns

string[]

GetNameListing(string)

string[] GetNameListing(string path)

Parameters

path string

Returns

string[]

GetObjectInfo(string, bool)

FtpListItem GetObjectInfo(string path, bool dateModified = false)

Parameters

path string
dateModified bool

Returns

FtpListItem

GetReply()

FtpReply GetReply()

Returns

FtpReply

GetWorkingDirectory()

string GetWorkingDirectory()

Returns

string

HasFeature(FtpCapability)

bool HasFeature(FtpCapability cap)

Parameters

cap FtpCapability

Returns

bool

MoveDirectory(string, string, FtpRemoteExists)

bool MoveDirectory(string path, string dest, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite)

Parameters

path string
dest string
existsMode FtpRemoteExists

Returns

bool

MoveFile(string, string, FtpRemoteExists)

bool MoveFile(string path, string dest, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite)

Parameters

path string
dest string
existsMode FtpRemoteExists

Returns

bool

OpenAppend(string, FtpDataType, bool)

Stream OpenAppend(string path, FtpDataType type = FtpDataType.Binary, bool checkIfFileExists = true)

Parameters

path string
type FtpDataType
checkIfFileExists bool

Returns

Stream

OpenAppend(string, FtpDataType, long)

Stream OpenAppend(string path, FtpDataType type, long fileLen)

Parameters

path string
type FtpDataType
fileLen long

Returns

Stream

OpenRead(string, FtpDataType, long, bool)

Stream OpenRead(string path, FtpDataType type = FtpDataType.Binary, long restart = 0, bool checkIfFileExists = true)

Parameters

path string
type FtpDataType
restart long
checkIfFileExists bool

Returns

Stream

OpenRead(string, FtpDataType, long, long)

Stream OpenRead(string path, FtpDataType type, long restart, long fileLen)

Parameters

path string
type FtpDataType
restart long
fileLen long

Returns

Stream

OpenWrite(string, FtpDataType, bool)

Stream OpenWrite(string path, FtpDataType type = FtpDataType.Binary, bool checkIfFileExists = true)

Parameters

path string
type FtpDataType
checkIfFileExists bool

Returns

Stream

OpenWrite(string, FtpDataType, long)

Stream OpenWrite(string path, FtpDataType type, long fileLen)

Parameters

path string
type FtpDataType
fileLen long

Returns

Stream

Rename(string, string)

void Rename(string path, string dest)

Parameters

path string
dest string

SetFilePermissions(string, FtpPermission, FtpPermission, FtpPermission)

void SetFilePermissions(string path, FtpPermission owner, FtpPermission group, FtpPermission other)

Parameters

path string
owner FtpPermission
group FtpPermission
other FtpPermission

SetFilePermissions(string, int)

void SetFilePermissions(string path, int permissions)

Parameters

path string
permissions int

SetModifiedTime(string, DateTime)

void SetModifiedTime(string path, DateTime date)

Parameters

path string
date DateTime

SetWorkingDirectory(string)

void SetWorkingDirectory(string path)

Parameters

path string

UploadBytes(byte[], string, FtpRemoteExists, bool, Action<FtpProgress>)

FtpStatus UploadBytes(byte[] fileData, string remotePath, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = false, Action<FtpProgress> progress = null)

Parameters

fileData byte[]
remotePath string
existsMode FtpRemoteExists
createRemoteDir bool
progress Action<FtpProgress>

Returns

FtpStatus

UploadDirectory(string, string, FtpFolderSyncMode, FtpRemoteExists, FtpVerify, List<FtpRule>, Action<FtpProgress>)

List<FtpResult> UploadDirectory(string localFolder, string remoteFolder, FtpFolderSyncMode mode = FtpFolderSyncMode.Update, FtpRemoteExists existsMode = FtpRemoteExists.Skip, FtpVerify verifyOptions = FtpVerify.None, List<FtpRule> rules = null, Action<FtpProgress> progress = null)

Parameters

localFolder string
remoteFolder string
mode FtpFolderSyncMode
existsMode FtpRemoteExists
verifyOptions FtpVerify
rules List<FtpRule>
progress Action<FtpProgress>

Returns

List<FtpResult>

UploadFile(string, string, FtpRemoteExists, bool, FtpVerify, Action<FtpProgress>)

FtpStatus UploadFile(string localPath, string remotePath, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = false, FtpVerify verifyOptions = FtpVerify.None, Action<FtpProgress> progress = null)

Parameters

localPath string
remotePath string
existsMode FtpRemoteExists
createRemoteDir bool
verifyOptions FtpVerify
progress Action<FtpProgress>

Returns

FtpStatus

UploadFiles(IEnumerable<FileInfo>, string, FtpRemoteExists, bool, FtpVerify, FtpError, Action<FtpProgress>, List<FtpRule>)

List<FtpResult> UploadFiles(IEnumerable<FileInfo> localFiles, string remoteDir, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = true, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None, Action<FtpProgress> progress = null, List<FtpRule> rules = null)

Parameters

localFiles IEnumerable<FileInfo>
remoteDir string
existsMode FtpRemoteExists
createRemoteDir bool
verifyOptions FtpVerify
errorHandling FtpError
progress Action<FtpProgress>
rules List<FtpRule>

Returns

List<FtpResult>

UploadFiles(IEnumerable<string>, string, FtpRemoteExists, bool, FtpVerify, FtpError, Action<FtpProgress>, List<FtpRule>)

List<FtpResult> UploadFiles(IEnumerable<string> localPaths, string remoteDir, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = true, FtpVerify verifyOptions = FtpVerify.None, FtpError errorHandling = FtpError.None, Action<FtpProgress> progress = null, List<FtpRule> rules = null)

Parameters

localPaths IEnumerable<string>
remoteDir string
existsMode FtpRemoteExists
createRemoteDir bool
verifyOptions FtpVerify
errorHandling FtpError
progress Action<FtpProgress>
rules List<FtpRule>

Returns

List<FtpResult>

UploadStream(Stream, string, FtpRemoteExists, bool, Action<FtpProgress>)

FtpStatus UploadStream(Stream fileStream, string remotePath, FtpRemoteExists existsMode = FtpRemoteExists.Overwrite, bool createRemoteDir = false, Action<FtpProgress> progress = null)

Parameters

fileStream Stream
remotePath string
existsMode FtpRemoteExists
createRemoteDir bool
progress Action<FtpProgress>

Returns

FtpStatus