Library functions: ISAPI calls |
The functions in this class allow a script to interact with Microsoft® Internet
Information Server; they are specific to the ISAPI version of Proteus: the value of the
public identifier OS is 3 if the script is being run by the
ISAPI interpreter; besides, the directive ISAPI
is pre-defined, so it is possible to conditionally execute part of the code by enclosing
it between !ifdef
ISAPI and endif.
ISAPIGETDATA()
retrieves and returns the contents of the POST operation initiated by the client; run URLDECODE on the result to process the returned information.
ISAPIGETVAR(cVarName)
returns the value of the specified value; cVarName can be one of the following strings:
- CONTENT_LENGTH
- REQUEST_METHOD
- CONTENT_TYPE
- PATH_INFO
- PATH_TRANSLATED
- QUERY_STRING
- ALL_HTTP
- AUTH_PASS
- AUTH_TYPE
- GATEWAY_INTERFACE
- HTTP_ACCEPT
- REMOTE_ADDR
- REMOTE_HOST
- REMOTE_USER
- SCRIPT_NAME
- SERVER_NAME
- SERVER_PORT
- SERVER_PROTOCOL
- SERVER_SOFTWARE
See the documents accompanying IIS for further information.
ISAPISERVFUNC(nRequest, nStatus, cHeader)
invokes the extended function corresponding to nRequest passing the specified parameters, nStatus and cHeader; returns 0 on success, -1 on error. The possible requests can be:
Value Description 1 Send a 302 message (URL Redirect) to the client. No further processing is required after the call. This operation is similar to specifying "URI: <URL>" in the header of a CGI script. 2 Send the specified data form the URL to the client, as if the client had requested the URL. No further processing is required after the call. 3 Send a full reply from the HTTP server, including status, server version, message time and MIME type. 4 Tell the server that the operation completed. See the documents accompanying IIS for further information.
ISAPITXFILE(cPathName, cMimeType)
transmits asyncronously the file corresponding to cPathName to the client ; the script can end immediately after the call to this function (if it was successfull, i.e. if the result was 0). If you want to send any binary file, you can use the following cMimeType:
"Content-type: application/binary;name=\"" FileName(S) \ "\"\r\nContent-Disposition: inline; filename=\"" FileName(S) "\""where FileName is the following function:
FUNCTION FileName(S) P = STRRSTR(S, "\\") IF NEQ(P, 0) RETURN RESTFROM(S, INC(P)) FI RETURN S
ISAPIWRITELOG(cText)
sets the string to be written to the log at the end of the transaction
Start of page | Next topic | Previous topic | Contents | Index |