Method Html3():img() Professional

Create HTML code for an image.

Syntax
:img(  <cWaaFile>    , ;
       [<cHttpFile>] , ;
       [<cAlt>]      , ;
       [<cAlign>]    , ;
       [<cWidth>]    , ;
       [<cHeight>] ) --> lSuccess
Parameters
<cWaaFile>
The parameter <cWaaFile> is the name of the file that shall be copied.
<cHttpFile>
The optional parameter <cHttpFile> becomes the name of the file on the HTTP server to which the file <cWaaFile> is copied to.
<cAlt>
The optional parameter <cAlt> becomes the value of the altproperty in the image tag.
<cAlign>
The optional parameter <cAlign> becomes the value of the alignproperty in the image tag.
<cWidth>
The optional parameter <cWidth> becomes the value of the widthproperty in the image tag.
<cHeight>
The optional parameter <cHeight> becomes the value of the heightproperty in the image tag.
Return

The method returns .T. (true) if image tag could be created successfully, otherwise .F. (false) is returned.

Description

The method creates the HTML image tag (<img>) with all required attributes and includes it in the HTML page. Before the image tag is included, the image file is copied from the WAA server machine to the HTTP server machine.

PRG code:

oHTML:img( "\images\logo.gif", "/temp/logo.gif" ) 

Resulting HTML code:

   <img src="cHttpFile" [alt="cAlt] [align="cAlign"] [width="cWidth] [height="cHeight]> 

If an HTML page is to contain images, only the URLs of the corresponding files are included in the HTML code. This requires the image files to reside on the computer where the HTTP server is running (they must be visible for the HTTP server). If the WAA server is running on another computer, the image files must be transferred from the WAA server machine to the HTTP server machine.

The file cWaaFile must be accessible from the package DLL, or Web application. Its name can include a complete path as it is usually coded in any Xbase++ application. The backslash "\" is used as delimiter for directories.

The file cHttpFile must be accessible from the HTTP server. The file name must include a directory which is located in the document root-directory of the HTTP server. This is normally the directory where temporary files are stored. The forward slash "/" is used as delimiter for directories.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.