Differences
This shows you the differences between the selected revisions of the page.
library_session_putfiletodirectory 2020-02-18 | library_session_putfiletodirectory 2024-01-05 (current) | ||
Line 6: | Line 6: | ||
===== Syntax ===== | ===== Syntax ===== | ||
<code csharp *> | <code csharp *> | ||
- | public TransferOperationResult PutFileToDirectory( | + | public TransferEventArgs PutFileToDirectory( |
string localFilePath, | string localFilePath, | ||
string remoteDirectory, | string remoteDirectory, | ||
Line 20: | Line 20: | ||
Optional remove As Boolean = False, | Optional remove As Boolean = False, | ||
Optional options As TransferOptions = Nothing | Optional options As TransferOptions = Nothing | ||
- | ) As TransferOperationResult | + | ) As TransferEventArgs |
</code> | </code> | ||
==== Parameters ==== | ==== Parameters ==== | ||
^ Name ^ Description ^ | ^ Name ^ Description ^ | ||
- | | string ==localFilePath== | Full path to the remote file to upload. | | + | | string ==localFilePath== | Full path to the local file to upload. | |
| string ==remoteDirectory == | Full path to the remote directory to upload the file to. | | | string ==remoteDirectory == | Full path to the remote directory to upload the file to. | | ||
| bool ==remove== | When set to ''true'', deletes the source local file(s) after a successful transfer. Defaults to ''false''. | | | bool ==remove== | When set to ''true'', deletes the source local file(s) after a successful transfer. Defaults to ''false''. | | ||
Line 31: | Line 31: | ||
==== Return Value ==== | ==== Return Value ==== | ||
- | ''[[library_transferoperationresult|TransferOperationResult]]''. | + | ''[[library_transfereventargs|TransferEventArgs]]''. |
===== Exceptions ===== | ===== Exceptions ===== | ||
Line 41: | Line 41: | ||
| TimeoutException | Timeout waiting for ''winscp.com'' to respond. | | | TimeoutException | Timeout waiting for ''winscp.com'' to respond. | | ||
- | ===== Remarks ===== | + | ===== [[remarks]] Remarks ===== |
- | Event ''[[library_session_filetransferred|Session.FileTransferred]]'' is raised. | + | Event ''[[library_session_filetransferred|Session.FileTransferred]]'' is raised. Also raises [[library_session_filetransferprogress|''Session.FileTransferProgress'']] throughout the transfer. |
Contrary to [[library_session_putfiles|''Session.PutFiles'']]: | Contrary to [[library_session_putfiles|''Session.PutFiles'']]: | ||
- | * You specify a path to the source file, not a [[library_wildcard|wildcard]], so you do not need to escape a literal file name. | ||
* You do not specify a target name (or an operation mask) in the destination path (original names are preserved when uploading). | * You do not specify a target name (or an operation mask) in the destination path (original names are preserved when uploading). | ||
* You do not need to make sure that the target directory path ends with a slash. | * You do not need to make sure that the target directory path ends with a slash. | ||
- | * The method upload files only. It throws when the source path points to a directory. | + | * The method uploads files only. It throws when the source path points to a directory. |
* The method throws an exception on error automatically. No need to [[library_session#results|call ''OperationResultBase.Check'']]. | * The method throws an exception on error automatically. No need to [[library_session#results|call ''OperationResultBase.Check'']]. | ||
+ | |||
+ | ===== Example ===== | ||
+ | |||
+ | ==== Real-Life Examples ==== | ||
+ | |||
+ | * [[library_example_zip_and_upload|*]]. | ||