Table of Contents

Class FtpFileStream

Namespace
FluentFTP.Streams
Assembly
FluentFTP.dll

Stream object for the local files

public static class FtpFileStream
Inheritance
FtpFileStream
Inherited Members

Methods

GetFileDateModifiedUtc(string)

Returns the file size using synchronous file I/O.

public static DateTime GetFileDateModifiedUtc(string localPath)

Parameters

localPath string

Returns

DateTime

GetFileDateModifiedUtcAsync(string, CancellationToken)

Returns the file size using synchronous file I/O.

public static Task<DateTime> GetFileDateModifiedUtcAsync(string localPath, CancellationToken token)

Parameters

localPath string
token CancellationToken

Returns

Task<DateTime>

GetFileReadStream(BaseFtpClient, string, bool, long, long)

Returns a new stream to upload a file from disk. If the file fits within the fileSizeLimit, then it is read in a single disk call and stored in memory, and a MemoryStream is returned. If it is larger than that, then a regular read-only FileStream is returned.

public static Stream GetFileReadStream(BaseFtpClient client, string localPath, bool isAsync, long fileSizeLimit, long knownLocalFileSize = 0)

Parameters

client BaseFtpClient
localPath string
isAsync bool
fileSizeLimit long
knownLocalFileSize long

Returns

Stream

GetFileSize(string, bool)

Returns the file size using synchronous file I/O.

public static long GetFileSize(string localPath, bool checkExists)

Parameters

localPath string
checkExists bool

Returns

long

GetFileSizeAsync(string, bool, CancellationToken)

Returns the file size using async file I/O.

public static Task<long> GetFileSizeAsync(string localPath, bool checkExists, CancellationToken token)

Parameters

localPath string
checkExists bool
token CancellationToken

Returns

Task<long>

GetFileWriteStream(BaseFtpClient, string, bool, long, long, bool, long)

Returns a new stream to download a file to disk. If the file fits within the fileSizeLimit, then a new MemoryStream is returned. If it is larger than that, then a regular writable FileStream is returned.

public static Stream GetFileWriteStream(BaseFtpClient client, string localPath, bool isAsync, long fileSizeLimit, long knownRemoteFileSize = 0, bool isAppend = false, long restartPos = 0)

Parameters

client BaseFtpClient
localPath string
isAsync bool
fileSizeLimit long
knownRemoteFileSize long
isAppend bool
restartPos long

Returns

Stream