Contact: zeng  @      Last update: 10 May 2011

IIS Extension

With this extension added to the Internet Information Service (IIS5 or IIS6), a form submission can be handled by ZeScript internally and efficiently. A ZeScript module used as CGI will get two variables: HTTP_IIS and HTTP_PARS. The former is a user object and can be used to call functions in the following table; and the later is an array that contains all GET or POST parameters. For example, for a submission like

You can echo parameter a and b back to use by inserting the following code in test.zs:

HTTP_IIS.send("<br />a="+HTTP_PARS.a+" b="+HTTP_PARS.b+"<br />"); 

Refer to METEX web site for application examples.

Function Parameter Type Remark
.mime(ext) string Sets MIME content type of response according file extension. If ext is not in the internal extension list, the function sets content type to ext. Here are the extensions and their corresponding contend types of the internal list: *→application/octet-stream, htm→text/html, html→text/html, pdf→application/pdf, jpeg→image/jpeg, png→image/png, mpg→video/mpeg, mpeg→video/mpeg, asf→video/x-ms-asf, avi→video/x-msvideo, bmp→image/bmp, jpg→image/jpeg, gif→image/gif, ico→image/x-icon, txt→text/plain, css→text/css, zip→application/x-zip-compressed, tgz→application/x-tar-gz, tar.gz→application/x-tar-gz, tar→application/x-tar, gz→application/x-gunzip, arj→application/x-arj-compressed, rar→application/x-arj-compressed, wav→audio/x-wav, mp3→audio/x-mp3, mid→audio/mid, m3u→audio/x-mpegurl, ram→audio/x-pn-realaudio, ra→audio/x-pn-realaudio, svg→image/svg+xml, doc→application/msword, exe→application/octet-stream, xls→application/excel, ppt→application/, rtf→application/rtf, mathml→application/mathml+xml, xml→application/xml, xsl→application/xml, dtd→application/xml-dtd, xslt→application/xslt+xml, xhtml→application/xhtml+xml, xht→application/xhtml+xml, mid→audio/midi, midi→audio/midi.
.send(str) string Sends to client HTML content in text.
.send(ptr, n) user, integer Sends to client n-bytes of raw data. Note that the content type should be set properly.
.vars(name) string Returns IIS server viable. Refer to IIS reference for variable names.