Differences

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

library_session_getfiletodirectory 2019-09-26 library_session_getfiletodirectory 2024-09-19 (current)
Line 3: Line 3:
This is a convenient alternative to [[library_session_getfiles|''Session.GetFiles'']], when you want to download only one specific file to a specific local directory, keeping its original name. This is a convenient alternative to [[library_session_getfiles|''Session.GetFiles'']], when you want to download only one specific file to a specific local directory, keeping its original name.
- 
-&beta_feature 
===== Syntax ===== ===== Syntax =====
<code csharp *> <code csharp *>
-public TransferOperationResult GetFileToDirectory(+public TransferEventArgs GetFileToDirectory(
    string remoteFilePath,     string remoteFilePath,
    string localDirectory,     string localDirectory,
Line 22: 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 28: 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 44: 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 53: 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. 

Last modified: by martin