wodSFTP API library - PutDataAt Method
      
 

Description

Receives a file from the server, starting from a given position.


Return type

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


Syntax

long Sftp_PutDataAt(void *Sftp, char *Data, char *RemotePath, __int64 RemotePos);

The PutDataAt function syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
char *Data Null-terminated data that will be stored on the server.
char *RemoteFile Full path to a file on the server.
__int64 RemotePos The position in the file that the data will be copied to.

Remarks

PutDataAt will copy the contents of the Data variable to the specified file on the server, starting at the given position. This is a very handy feature for small files that are stored in local variables within your programs. Although there is no size limit on sending data to the server this way, you should try to keep the amount below 64kb.

What will PutDataAt do for you? It will copy the contents of the specified variable to a temporary file on a local disk (in a temporary folder) and then copy that file to the server. Keep in mind that for this method you *MUST* allow the component to write to your disk. If you are using wodSFTP in an environment such as ASP, make sure that the Guest user has sufficient privileges to create temporary files.

Once the file has been created and sent to the server, it will be deleted from the local disk.

If you prefer to send binary data (that is not null-terminated) use the PutDataLenAt function.