Method Html3():putFile() Professional

Copy a file from the WAA server machine to the HTTP server machine.

Syntax
:putFile( <cWaaFile>, [<cHttpFile>] ) --> aReturn
Parameters
<cWaaFile>
The parameter <cWaaFile> is the name of the file to be copied.
<cHttpFile>
The optional parameter <cHttpFile> is the name of the file on the HTTP server to which the file <cWaaFile> is copied to.
Return

The method returns .T. (true) if the file was copied successfully, otherwise .F. (false) is returned.

Description

The method :putFile() can be used to copy a file from the WAA server machine to the HTTP server machine. This can be usefull, for example, when the HTML page shall contain references to images on the HTTP server machine.

When an HTML page is to include a background image follwing code sequence can be used:

oHTML:putFile( "images\background.gif", ; 
               "temp/bgrd.gif" ) 
oHTML:header(  "My Web Application",    ; 
               'BACKGROUND="/temp/bgrd.gif"' ) 

If an HTML page shall reference files, only the URLs of the corresponding files are included in the HTML code. This requires the 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 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.