Windows CGI


The WINCGI-interface is a direct interface to pure Windows backend programs (16 and 32 bits). Thus it's easy to write backends in ACCESS, C, Foxpro, VB or any other programming language. This enables you to use Windows specific features, such as DDE, OLE and even ODBC.

How the WINCGI works

The server provides the input data for the called Windows program on the command line, a private profile and a content file. The content file contains additional data sent by the client. On the output side the called Windows program generates an output file, which is sent to the client.

Command line

Four command line parameters are needed

The directory used for the input and output files is defined in aliAdmin. During script development it is useful to turn off automatic deleting of generated files.

For more information on these parameters see Section [WINSCRIPTALIAS] in the Registry description.

Example how a WINCGI program is called:

C:\HTTPD\CGI-BIN\TSTWIN.EXE c:\tmp\xxxx.ini

INI file for parameter passing: Section [CGI]

Each entry works like the environment variables set in the standard CGI interface, for a detailed description see Scripts, CGI and how it works.
The section CGI contains following entries:

Section [ACCEPT]

All accept fields received are written in the form accept=quality
1 is assumed if not stated otherwise

Example:


[ACCEPT]

text/plain=1.00

text/html=1.00

audio/x-aiff=1.00

audio/basic=1.00

*/*=1.00

Section [SYSTEM]

Section [EXTRA HEADERS]

Here all values retrieved by a get command are included, in name=value manner.

Example:

[EXTRAHEADERS]

var1=Value_1

var2=Value_2

Section [FORM LITERAL]

Here all values retrieved by a POST command are included, in name=value manner. In this section we place all values which are less then 1500 bytes, if they are longer, they are put into section [FORM EXTERNAL].

Section [FORM EXTERNAL]

Here all values retrieved by a POST command are included, in name=filename size manner.

The files contain the values without any modification.

Be sure to read them with binary file attributes, so that no automatic conversion takes place.

Example:


NAME_VAR=c:\tmp/03147835.0 181777

Section [FORM HUGE]

If a string in the content file is more than 64kB, it is referenced here in the form name=offset length.

Offset points to the beginning of the string in the content file and length is the size of the string. Both values are in bytes.

Be sure to open the content file in binary mode, so that no automatic conversion takes place.


Back to the Extending OmniHTTPd functionality page

Copyright © 1996 Omnicron Technologies Corporation


Casa de Bender