WebTcpipSendFile Function

Action

Sends the data of a file in binary mode to the remote host. Before WebTcpipSendFile can be used, a valid connection has to be established with WebTcpipConnect.

Include file

WebAPI.bdh

Syntax

WebTcpipSendFile( in hWeb      : number,
                  in sFileName : string ): boolean;

Return value

  • true if the file was sent successfully

  • false otherwise

Parameter Description
hWeb Valid handle to a Web connection that was created by WebTcpipConnect
sFileName File to send to the server. The file is opened in binary mode and sent until end of file.

Example

dcltrans
transaction TWebApplevel
  var
    hWeb: number;
  begin
    WebTcpipConnect(hWeb, "standardhost", WEB_PORT_HTTP);
    WebTcpipSendFile(hWeb, "c:\\temp\\archive.zip");
    WebTcpipShutdown(hWeb);
  end TWebApplevel;

Sample scripts

WebFileUpload01.bdf