WebFtpPut Function


Puts random data bytes in a file on the FTP server.

Include file



WebFtpPut( in hFtp            : number, 
           in nBytes          : number, 
           in sRemoteFile     : string, 
           in bBinaryTransfer : boolean): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hFtp Valid handle to an FTP session
nBytes Number of bytes to be generated randomly
sRemoteFile String that contains the name of the file to create on the remote system. Can be either partially or fully qualified file name relative to the current directory. A backslash (\) or forward slash (/) can be used as the directory separator for either name. WebFtpPut translates the directory name separators to the appropriate character before they are used.

If this parameter is set to true, WebGetFile transfers the file using FTP's Image (Type I) transfer method. The file is transferred exactly as it exists with no changes. This is the default transfer method.

If this parameter is set to false, FTP's ASCII (Type A) transfer method is used. Control and formatting information is converted to local equivalents.


// Put random data bytes in a file on the FTP server. 
  transaction TWebFtpDir 
    hFtp   : number;
    nBytes : number; 
    WebFtpConnect(hFtp, "standardhost", WEB_PORT_FTP, 
                   "anonymous", "mymail@address.com");
    nBytes := RndUniN(1000..5000); 
    WebFtpPut(hFtp, nBytes, "RndGenTestFile", true);
  end TWebFtpDir;

Sample scripts