Back to product page

PutData function


Creates a directory on the server.

Type

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

Syntax

  • C
long Sftp_PutData(void *Sftp, char *Data, char *RemoteFile);
The PutData(void *Sftp,char *Data,char *RemoteFile) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *DataNull-terminated data that will be stored on the server.
char *RemoteFileFull path to a file on the server.

Remarks

Unlike the PutFile function that copies a local file to the server, PutData will copy the contents of the Data variable to the specified file on the server. This is a very handy feature for small files that are stored in local variables within your programs. Although there is no size limit for sending data to the server in this way, you should try to keep the amount below 64kb. This depends on how much data your programming environment is able to store in a String variable.

What will PutData 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 environment such as ASP, please make sure that the Guest user has sufficient privileges to create temporary files.

Once file has been created and is 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 PutDataLen function.

Platforms

Windows