Differences
This shows you the differences between the selected revisions of the page.
library_session_getfiles 2022-04-11 | library_session_getfiles 2022-08-12 (current) | ||
Line 2: | Line 2: | ||
[[task_download|Downloads]] one or more files from remote directory to local directory. | [[task_download|Downloads]] one or more files from remote directory to local directory. | ||
- | You can have WinSCP [[ui_generateurl|generate a code template]] for ''Session.GetFiles'' for you. | + | You can have WinSCP [[guide_automation#generating|generate a code template]] for ''Session.GetFiles'' for you. |
The method is quite powerful, but due to a wide range of it uses, its syntax can be cumbersome initially. For specific tasks, consider using convenient alternatives: [[library_session_getfilestodirectory|''Session.GetFilesToDirectory'']] and [[library_session_getfiletodirectory|''Session.GetFileToDirectory'']]. | The method is quite powerful, but due to a wide range of it uses, its syntax can be cumbersome initially. For specific tasks, consider using convenient alternatives: [[library_session_getfilestodirectory|''Session.GetFilesToDirectory'']] and [[library_session_getfiletodirectory|''Session.GetFileToDirectory'']]. | ||
Line 35: | Line 35: | ||
''[[library_transferoperationresult|TransferOperationResult]]''. See also [[library_session#results|Capturing results of operations]]. | ''[[library_transferoperationresult|TransferOperationResult]]''. See also [[library_session#results|Capturing results of operations]]. | ||
- | totally null | + | ===== [[exceptions]] Exceptions ===== |
+ | ^ Exception ^ Condition ^ | ||
+ | | InvalidOperationException | Session is not opened. | | ||
+ | | ArgumentException \\ ArgumentOutOfRangeException | Invalid combination of values of ''[[library_transferoptions|TransferOptions]]'' properties. | | ||
+ | | [[library_sessionlocalexception|SessionLocalException]] | Error communicating with ''[[executables#winscp.com|winscp.com]]''. \\ See the exception documentation for details. | | ||
+ | | [[library_sessionremoteexception|SessionRemoteException]] | Session has failed. \\ Downloading of files has failed. \\ See the exception documentation for details. | | ||
+ | | TimeoutException | Timeout waiting for ''winscp.com'' to respond. | | ||
===== Remarks ===== | ===== Remarks ===== | ||
Line 62: | Line 68: | ||
UserName = "user", | UserName = "user", | ||
Password = "mypassword", | Password = "mypassword", | ||
- | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...=" | + | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
}; | }; | ||
Line 115: | Line 121: | ||
.UserName = "user" | .UserName = "user" | ||
.Password = "mypassword" | .Password = "mypassword" | ||
- | .SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...=" | + | .SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
End With | End With | ||
Line 165: | Line 171: | ||
UserName = "user" | UserName = "user" | ||
Password = "mypassword" | Password = "mypassword" | ||
- | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...=" | + | SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
} | } | ||
Line 222: | Line 228: | ||
sessionOptions.UserName = "user"; | sessionOptions.UserName = "user"; | ||
sessionOptions.Password = "mypassword"; | sessionOptions.Password = "mypassword"; | ||
- | sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...="; | + | sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..."; |
var session = WScript.CreateObject("WinSCP.Session"); | var session = WScript.CreateObject("WinSCP.Session"); | ||
Line 283: | Line 289: | ||
.UserName = "user" | .UserName = "user" | ||
.Password = "mypassword" | .Password = "mypassword" | ||
- | .SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx...=" | + | .SshHostKeyFingerprint = "ssh-rsa 2048 xxxxxxxxxxx..." |
End With | End With | ||