TransferOptions Class

Defines options for file transfers.

You can have WinSCP generate a code template for TransferOptions for you.



Namespace: WinSCP

public sealed class TransferOptions
Public NotInheritable Class TransferOptions


Name Description
TransferOptions() Default constructor.


Name Description
string FileMask File mask.
FilePermissions FilePermissions Permissions to applied to a remote file (used for uploads only). Use default null to keep default permissions.
SFTP and SCP protocols only. Has no effect when streaming (Session.PutFile).
OverwriteMode OverwriteMode Behavior when overwriting existing files.
Possible values are:
OverwriteMode.Overwrite (default) to overwrite the existing files.
OverwriteMode.Resume to assume that the existing and smaller file is a remnant of an interrupted transfer and resumes the transfer. SFTP and FTP protocols only.
OverwriteMode.Append to append the source file to the end of existing target file. SFTP protocol only.
The value is not relevant when streaming a remote file (Session.GetFile). When streaming a local file (Session.PutFile), only OverwriteMode.Append is relevant.
bool PreserveTimestamp Preserve timestamp (set last write time of destination file to that of source file). Defaults to true.
When used with Session.SynchronizeDirectories, timestamp is always preserved, disregarding property value, unless criteria parameter lacks SynchronizationCriteria.Time.
Has no effect when streaming (Session.GetFile and Session.PutFile).
TransferResumeSupport ResumeSupport Configures automatic resume/transfer to temporary filename.
Has no effect when streaming (Session.GetFile and Session.PutFile).
int SpeedLimit Limit transfer speed (in KB/s).
TransferMode TransferMode Transfer mode. Possible values are TransferMode.Binary (default), TransferMode.Ascii and TransferMode.Automatic (based on file extension).



Name Description
AddRawSettings Allows configuring any transfer settings using raw format as in an INI file.


Use instance of the class with Session.GetFiles, Session.PutFiles or Session.SynchronizeDirectories.


See overall example for WinSCP .NET assembly.

Real-Life Example

Last modified: by martin