This is an old revision of the document!
Session.PutFiles Method
Uploads one or more files from local directory to remote directory.
This feature will be available only with the next release.
Advertisement
Syntax
public OperationResult<TransferArgs> PutFiles( string localPath, string remotePath, bool remove = false, TransferOptions options = null )
Parameters
Name | Description |
---|---|
string localPath | Full path to local file or directory to upload. Filename in the path can be replaced with Windows wildcard1 to select multiple files. When file name is omited (path ends with backslash), all files and subdirectories in the local directory are uploaded. |
string remotePath | Full path to upload the file to. When uploading multiple files, the filename in the path should be replaced with operation mask or omited (path ends with slash). |
bool remove | When set to true , deletes source local file(s) after transfer. Defaults to false . |
TransferOptions options | Transfer options. Defaults to null , what is equivalent to new TransferOptions() . |
Return Value
OperationResult<T>
holding collection of TransferEventArgs
. See also Capturing results of operations.
Advertisement
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Session is not opened. |
ArgumentException ArgumentOutOfRangeException |
Invalid combination of values of TransferOptions properties. |
SessionLocalException | Error communicating with winscp.com . See the exception documentation for details. |
TimeoutException | Timeout waiting for winscp.com to respond. |
Remarks
Event Session.FileTransferred
is raised for every uploaded file.
Example
- Windows wildcard supports
*
and?
only. It does not support all the features of file masks.Back