Description
-
Appends data from a string variable to a remote file.
Return type
-
A Long value. If successful, 0 is returned, otherwise
error as specified here.
Syntax
-
long Sftp_AppendData(void *Sftp, char *Data,
char *RemoteFile);
The AppendData function syntax has these parts:
| void
*Sftp |
Handle of 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. |
Remarks
-
Unlike the AppendFile
method which appends the contents of a local file to the server, AppendData
will append 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
on sending data to the server in this way, you should try to limit data to
64kb - this will depend upon on how much data your programming
environment able to store in a String variable.
What will AppendData do for you? It will copy the contents of the
specified variable to a temporary file on disk (in the temporary
folder) and then append that file to the server. Keep in mind
that for this method to work you *MUST* allow the component to write to your
disk. If you are using wodSFTP in an environment such as ASP, make
sure the Guest user has privileges to create temporary files.
Once this temporary file is sent to the server, it will be deleted
from the local disk.
|