Back to product page
- Introduction
- Overview
- License agreement
- Classes
- Enumerations
- wodSFTPdll
- Create function
- Destroy function
- Methods
- Abort
- About
- AppendData
- AppendDataLen
- AppendFile
- Connect
- DeleteFile
- DeleteFiles
- Disconnect
- ExtendedCmd
- GetAttributes
- GetData
- GetDataAt
- GetDataToBuffer
- GetDataToBufferAt
- GetFile
- GetFileAt
- GetFiles
- ListAttributes
- ListDir
- ListNames
- LoadPrivateKey
- LoopFiles
- MakeDir
- PutData
- PutDataAt
- PutDataLen
- PutDataLenAt
- PutFile
- PutFileAt
- PutFiles
- RealPath
- RemoteClose
- RemoteOpen
- RemoteRead
- RemoteWrite
- RemoveDir
- Rename
- SetAttributes
- Properties
- Authentication
- Blocking
- BufferSize
- ClientName
- Compression
- Encryption
- EncryptionList
- ErrorText
- Extensions
- FIPS
- HMacList
- Hostname
- KeyExchangeList
- KeySignatureList
- LastError
- ListItem
- LocalPath
- Login
- MaxTransferRate
- MyHostname
- MyIP
- Password
- Port
- PrivateKey
- ProxyHostname
- ProxyLogin
- ProxyPassword
- ProxyPort
- ProxyType
- RemoteIdentification
- RemotePath
- Resume
- ServerErrorCode
- ServerErrorText
- State
- StateText
- Timeout
- Timezone
- TransferMode
- TransferRate
- TransferTime
- UseIPv6
- Version
- Callbacks
- How to get support
- Using callbacks
- Technical information
- Error list
GetFile function
Receives a file from the server.
Type
A Long value. If successful, 0 is returned, otherwise error as specified hereSyntax
- C
long Sftp_GetFile(void *Sftp, char *LocalFile, char *RemoteFile);
The GetFile(void *Sftp,char *LocalFile,char *RemoteFile) syntax has these parts:
The GetFile(void *Sftp,char *LocalFile,char *RemoteFile) syntax has these parts:
void *Sftp | Handle of the created Sftp instance. |
char *LocalFile | Full path to a filename (or directory) on your local disk. |
char *RemoteFile | Full path to a file on the remote server. |
Remarks
The GetFile function will initiate the copying of a file from the remote server to the local computer. During the transfer, the Progress event will be fired several times, depending on your network connection speed and the size of the file. When the copy is complete, the Done event will be fired. If an error occurs during the transfer, the Done event containing the ErrorCode and a description of the error, will be fired immediately and the transfer will be aborted. If you want to continue the transfer later or you want to try to receive the file again, initiate the GetFile method again (immediately or after reconnecting, depending on the error that occurred). You may also use the Resume property to resume the transfer from the position where the error occurred. This method can be initiated only when the State property is set to Connected. You cannot receive a file if wodSFTP is busy doing something else. Although the RemoteFile argument MUST contain the full path including the filename of the file you wish to receive, you can omit the LocalPath argument. For instance, you can setLocalPath = "C:\Temp"
in which case wodSFTP will automatically copy it with the same name as it has on remote server. If you want to specify that is copied with another name, you should include it in the LocalPath argument. If you don't specify the LocalPath or RemoteFile arguments, wodSFTP will use values set in the LocalPath and RemotePath properties. No wildcards can be used for RemotePath argument. The RFC protocol specification for SFTP does not allow them.