Back to product page

AppendFile function


Appends to a remote file.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_AppendFile(void *Sftp, char *LocalFile, char *RemotePath);
The AppendFile(void *Sftp,char *LocalFile,char *RemotePath) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *LocalFileFull path to file on local computer.
char *RemotePathFull path to file/directory on the server.

Remarks

The AppendFile function will copy a file residing on the local computer to the remote server that you are connected to, by appending to the end of the remote file. During the transfer, the Progress callback will be called several times, depending on your network speed and the length of the file. When copying is complete, the Done callback will be called.

AppendFile cannot be used when Resume is set to True.

If an error occurs during transfer, the Done callback will be called immediately, containing an ErrorCode and a description of the error and the transfer will be aborted. This function can be initiated only when the State property is set to Connected. You cannot send a file if wodSFTP is busy doing something else.

Although the LocalFile argument MUST contain the full path including the filename of the file you wish to send, you can omit the RemotePath argument. For example, you can set:
 
RemotePath = "/tmp"
 

in which case wodSFTP will automatically copy it with the same name as it has locally. If you wish to specify that it is copied with another name, you must include it in the RemotePath argument.

If you don't specify LocalFile or RemotePath argument, wodSFTP will use the values set in the LocalPath and RemotePath properties.

No wildcards can be used with the RemotePath argument. The RFC protocol specification for SFTP does not allow them.

Platforms

Windows