Back to product page
- Introduction
- License agreement
- Classes
- Enumerations
- Exceptions
- WeOnlyDo.Client.SFTP
- Methods
- Properties
- Authentication
- Blocking
- BufferSize
- Compression
- Encryption
- EncryptionList
- HMacList
- Hostname
- KeepAlives
- KeyExchangeList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- State
- Timeout
- TransferMode
- TransferRate
- TransferTime
- Version
- Events
- How to get support?
GetFile method
Downloads file from the server.
Type
VoidSyntax
- C#
- VB.NET
public Void GetFile();
public Void GetFile(Stream ToStream);
The GetFile(ToStream) syntax has these parts:
public Void GetFile(String RemoteFile);
The GetFile(RemoteFile) syntax has these parts:
public Void GetFile(Stream ToStream, String RemoteFile);
The GetFile(ToStream,RemoteFile) syntax has these parts:
public Void GetFile(String LocalPath, String RemoteFile);
The GetFile(LocalPath,RemoteFile) syntax has these parts:
public Void GetFile(Stream ToStream);
The GetFile(ToStream) syntax has these parts:
ToStream | Writable stream where contents of the file will be stored. |
public Void GetFile(String RemoteFile);
The GetFile(RemoteFile) syntax has these parts:
RemoteFile | Path to the file on the server. |
public Void GetFile(Stream ToStream, String RemoteFile);
The GetFile(ToStream,RemoteFile) syntax has these parts:
ToStream | Writable stream where contents of the file will be stored. |
RemoteFile | Path to the file on the server. |
public Void GetFile(String LocalPath, String RemoteFile);
The GetFile(LocalPath,RemoteFile) syntax has these parts:
LocalPath | Local path of filename where file will be saved. |
RemoteFile | Path to the file on the server. |
public Sub GetFile()
public Sub GetFile(ByVal ToStream As Stream)
The GetFile(ToStream) syntax has these parts:
public Sub GetFile(ByVal RemoteFile As String)
The GetFile(RemoteFile) syntax has these parts:
public Sub GetFile(ByVal ToStream As Stream, ByVal RemoteFile As String)
The GetFile(ToStream,RemoteFile) syntax has these parts:
public Sub GetFile(ByVal LocalPath As String, ByVal RemoteFile As String)
The GetFile(LocalPath,RemoteFile) syntax has these parts:
public Sub GetFile(ByVal ToStream As Stream)
The GetFile(ToStream) syntax has these parts:
ToStream | Writable stream where contents of the file will be stored. |
public Sub GetFile(ByVal RemoteFile As String)
The GetFile(RemoteFile) syntax has these parts:
RemoteFile | Path to the file on the server. |
public Sub GetFile(ByVal ToStream As Stream, ByVal RemoteFile As String)
The GetFile(ToStream,RemoteFile) syntax has these parts:
ToStream | Writable stream where contents of the file will be stored. |
RemoteFile | Path to the file on the server. |
public Sub GetFile(ByVal LocalPath As String, ByVal RemoteFile As String)
The GetFile(LocalPath,RemoteFile) syntax has these parts:
LocalPath | Local path of filename where file will be saved. |
RemoteFile | Path to the file on the server. |
Remarks
GetFile method will initiate copying of file residing on remote server to the local computer. During the transfer, Progress event will be fired several times, depending on your network speed and length of the file.When the copying is completed, Done event will be fired.
If an error occurs during transfer, Done event will be fired immediately containing ErrorCode and description for the error, and transfer will be aborted. If you want to continue it later, or try to re-receive the file, initiate GetFile method again (immediately or after reconnecting, depends on error that occurred). You may also use Resume property to resume transferring from the position where the error occurred.
This method can be initiated only when State property is set to Connected. You cannot receive file if wodSFTP.NET is busy doing something else.
Although RemoteFile argument MUST contain full path including filename of the file you wish to receive, LocalPath can omit filename. For instance, you can set
LocalPath = "C:\Temp"
in which case wodSFTP.NET will automatically copy it with the same name as it is on remote server. If you wish to specify that is copied with some other name, you have to include it in LocalPath argument.
If you don't specify LocalPath or RemoteFile argument, wodSFTP.NET will use values set in LocalPath and RemotePath properties.
No wildcards can be used for RemotePath argument. RFC protocol specification for SFTP does not allow them.