PowerTCP SSH and SFTP for .NET
Put(String,String,Boolean,Boolean,CopyMode) Method




An absolute or relative (from the current working directory) path specifying the search pattern on the client. Must contain a wildcard (*).
An absolute or relative (from WorkingDirectory) path specifying the destination root directory on the server.
Specify true to search sub-directories recursively.
Specify true to include empty folders in the results.
Specifies the type of copy to perform.
Sequentially copies multiple files from the local client to the remote server.
Syntax
'Declaration
 
Public Overloads Function Put( _
   ByVal localSearchPattern As String, _
   ByVal remoteDirectory As String, _
   ByVal recurse As Boolean, _
   ByVal includeEmptyFolders As Boolean, _
   ByVal mode As CopyMode _
) As CopyResult()
'Usage
 
Dim instance As Sftp
Dim localSearchPattern As String
Dim remoteDirectory As String
Dim recurse As Boolean
Dim includeEmptyFolders As Boolean
Dim mode As CopyMode
Dim value() As CopyResult
 
value = instance.Put(localSearchPattern, remoteDirectory, recurse, includeEmptyFolders, mode)

Parameters

localSearchPattern
An absolute or relative (from the current working directory) path specifying the search pattern on the client. Must contain a wildcard (*).
remoteDirectory
An absolute or relative (from WorkingDirectory) path specifying the destination root directory on the server.
recurse
Specify true to search sub-directories recursively.
includeEmptyFolders
Specify true to include empty folders in the results.
mode
Specifies the type of copy to perform.
Exceptions
ExceptionDescription
System.ArgumentExceptionThrown if the localSearchPattern does not contain a wildcard character (*).
Remarks

Use this overload to automatically create the folder structure on the server if the file(s) to upload includes a path that needs to be created on the server.

This method will only raise an exception if the localSearchPattern is invalid. For exceptions that occurred during execution, check CopyResult.GetException() of each returned CopyResult.

The Progress event is raised as this method executes if an event handler is attached.

If Sftp.ThreadingModel is ThreadingModel.ApartmentAsync, this method immediately returns a null value after starting a worker thread that executes the operation asynchronously. The Progress event is raised containing the result upon completion.

See Also

Reference

Sftp Class
Sftp Members
Overload List


PowerTCP SSH and SFTP for .NET Documentation Version 7.0
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic