Back to product page

PutDataLenAt function


Stores data from a fixed-size buffer to a remote file, at a given position.

Type

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

Syntax

  • C
long Sftp_PutDataLenAt(void *Sftp, void *Data, int DataLen, char *RemotePath, __int64 RemotePos);
The PutDataLenAt(void *Sftp,void *Data,int DataLen,char *RemoteFile,__int64 RemotePos) syntax has these parts:
void *SftpHandle of the created Sftp instance.
void *DataRepresents data that will be stored on the server.
int DataLenLength of the data buffer.
char *RemoteFileFull path to a file on the server.
__int64 RemotePosThe position in the file that the data will be copied to.

Remarks

The PutDataLenAt function will copy the contents of the Data buffer to the specified file on the server, at a given position. This is a very handy feature for small files that are stored in local variables within your programs.

What will PutDataLenAt do for you? It will copy the contents of the specified variable to a temporary file on the 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.

Platforms

Windows