Differences
This shows you the differences between the selected revisions of the page.
library_session_getfiletodirectory 2020-02-18 | library_session_getfiletodirectory 2024-09-19 (current) | ||
Line 6: | Line 6: | ||
===== Syntax ===== | ===== Syntax ===== | ||
<code csharp *> | <code csharp *> | ||
- | public TransferOperationResult GetFileToDirectory( | + | public TransferEventArgs GetFileToDirectory( |
string remoteFilePath, | string remoteFilePath, | ||
string localDirectory, | string localDirectory, | ||
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> | ||
Line 26: | Line 26: | ||
^ Name ^ Description ^ | ^ Name ^ Description ^ | ||
| string ==remoteFilePath== | Full path to the remote file to download. | | | string ==remoteFilePath== | Full path to the remote file to download. | | ||
- | | string ==localDirectory== | Full path to the local directory to download the file to. The directory is created, if it does not exist. | | + | | string ==localDirectory== | Full path to the local directory to download the file to. | |
| bool ==remove== | When set to ''true'', deletes source remote file after a successful transfer. Defaults to ''false''. | | | bool ==remove== | When set to ''true'', deletes source remote file after a successful transfer. Defaults to ''false''. | | ||
| [[library_transferoptions|TransferOptions]] options | Transfer options. Defaults to ''null'', what is an equivalent to ''new TransferOptions()''. | | | [[library_transferoptions|TransferOptions]] options | Transfer options. Defaults to ''null'', what is an equivalent to ''new TransferOptions()''. | | ||
==== Return Value ==== | ==== Return Value ==== | ||
- | ''[[library_transferoperationresult|TransferOperationResult]]''. | + | ''[[library_transfereventargs|TransferEventArgs]]''. |
===== Exceptions ===== | ===== Exceptions ===== | ||
Line 42: | Line 42: | ||
===== 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_getfiles|''Session.GetFiles'']]: | Contrary to [[library_session_getfiles|''Session.GetFiles'']]: | ||
Line 51: | Line 51: | ||
* The method downloads files only. It throws when the source path points to a directory. | * The method downloads 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'']]. | ||
- | * If the target local directory does not exist, it is created. | ||