The ftpproxy() call transfers a file between two remote servers without sending the file to the local host.
Syntax
#include <ftpapi.h> int ftpproxy(host1, userid1, passwd1, acct1, host2, userid2, passwd2, acct2, fn1, fn2, transfertype) char *host1; char *userid1; char *passwd1; char *acct1; char *host2; char *userid2; char *passwd2; char *acct2; char *fn1; char *fn2; int transfertype;
Parameters
host1
To specify the port number (other than the well-know port) used by the FTP server, code the host name, followed by a blank, then the port number. For example, specify ftpproxy ("server1 1234",...)
To specify the port number (other than the well-know port) used by the FTP server, code the host name, followed by a blank, then the port number. For example, specify ftpproxy (host1,..."server2 1234",...)
Description
The ftpproxy() call copies a file on a specified source host directly to a specified target host, without involving the requesting host in the file transfer. This call is functionally the same as the FTP client subcommand proxy put.
Notes:
Return Values
The value 0 indicates success; the value -1 indicates an error. The value of ftperrno indicates the specific error. See Return Values for a description of the return codes.
Examples
int rc;rc=ftpproxy("pc1","oleg","erst",NULL, /* target host information*/ "pc2","yan", "dssa1", NULL, /* source host information*/ "\tmp\newdoc.1", /* target file name */ "\tmp\doc.1", /* source file name */ T_ASCII); /* ASCII transfer */
The ASCII file \tmp\doc.1 on the host pc2 is copied to host pc1 as the file \tmp\newdoc.1.