Differences

This shows you the differences between the selected revisions of the page.

library_transferoptions 2012-01-04 library_transferoptions 2024-02-15 (current)
Line 1: Line 1:
====== TransferOptions Class ====== ====== TransferOptions Class ======
-Defines options for file transfers.·+Defines options for file transfers.
-&future_feature+You can have WinSCP [[guide_automation#generating|generate a code template]] for ''TransferOptions'' for you. 
 + 
 +~~AD~~
===== Syntax ===== ===== Syntax =====
Namespace: ''WinSCP'' Namespace: ''WinSCP''
-<code csharp>+<code csharp *>
public sealed class TransferOptions public sealed class TransferOptions
 +</code>
 +
 +<code vbnet *>
 +Public NotInheritable Class TransferOptions
</code> </code>
Line 15: Line 21:
| TransferOptions() | Default constructor. | | TransferOptions() | Default constructor. |
-===== Properties =====+===== [[properties]] Properties =====
^ Name ^ Description ^ ^ Name ^ Description ^
-| string ExcludeMask | [[ui_transfer#other_options|Exclude mask]]. Only one of ''ExcludeMask'' and ''IncludeMask'' can be set at a time. | +| string ==FileMask== | [[file_mask|File mask]].
-| string IncludeMask | [[ui_transfer#other_options|Include mask]]. Only one of ''ExcludeMask'' and ''IncludeMask'' can be set at a time. | +| [[library_filepermissions|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 ([[library_session_putfile|''Session.PutFile'']]).
-| [[library_filepermissions|FilePermissions]] FilePermissions | Permissions to applied to a remote file (used for uploads only). Use default ''null'' to keep default permissions. | +| 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|SFTP protocol]] only. \\ The value is not relevant when streaming a remote file ([[library_session_getfile|''Session.GetFile'']]). When streaming a local file ([[library_session_putfile|''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''. | +| bool ==PreserveTimestamp== | Preserve timestamp (set last write time of destination file to that of source file). Defaults to ''true''. \\ When used with ''[[library_session_synchronizedirectories|Session.SynchronizeDirectories]]'', timestamp is always preserved, disregarding property value, unless ''criteria'' parameter lacks ''SynchronizationCriteria.Time''. \\ Has no effect when streaming ([[library_session_getfile|''Session.GetFile'']] and [[library_session_putfile|''Session.PutFile'']]). | 
-| TransferMode TransferMode | [[transfer_mode|Transfer mode]]. Possible values are ''TransferMode.Binary'' (default), ''TransferMode.Ascii'' and ''TransferMode.Automatic'' (based on file extension). |+| [[library_transferresumesupport|TransferResumeSupport]] ==ResumeSupport== | Configures [[resume#automatic|automatic resume/transfer to temporary filename]]. \\ Has no effect when streaming ([[library_session_getfile|''Session.GetFile'']] and [[library_session_putfile|''Session.PutFile'']]). | 
 +| int ==SpeedLimit== | Limit transfer speed (in KB/s). | 
 +| TransferMode ==TransferMode== | [[transfer_mode|Transfer mode]]. Possible values are ''TransferMode.Binary'' (default), ''TransferMode.Ascii'' and ''TransferMode.Automatic'' (based on file extension). | 
 + 
 +===== Methods ===== 
 +^ Name ^ Description ^ 
 +| [[library_transferoptions_addrawsettings|AddRawSettings]] | Allows configuring any transfer settings using raw format as in an INI file. |
===== Remarks ===== ===== Remarks =====
Use instance of the class with ''[[library_session_getfiles|Session.GetFiles]]'', ''[[library_session_putfiles|Session.PutFiles]]'' or ''[[library_session_synchronizedirectories|Session.SynchronizeDirectories]]''. Use instance of the class with ''[[library_session_getfiles|Session.GetFiles]]'', ''[[library_session_putfiles|Session.PutFiles]]'' or ''[[library_session_synchronizedirectories|Session.SynchronizeDirectories]]''.
-~~NOTOC~~+===== Examples ===== 
 +See [[library#example|overall example for WinSCP .NET assembly]]. 
 + 
 +==== Real-Life Example ==== 
 + 
 +  * [[script_locking_files_while_uploading|*]]. 

Last modified: by martin