Cgi Tcl Reference Documentation

Cgi

Current Version: 9.5.0.98

Provides the ability to receive HTTP requests and all associated parameters, HTTP header fields, etc. A common use is for receiving HTTP uploads. Provides the ability to receive uploads that stream directly to disk, eliminating memory requirements for large files. Also provides the ability to receive uploaded files directly in memory.

Object Creation

set myCgi [new CkCgi]

Properties

AsyncBytesRead
integer
set intVal [CkCgi_get_AsyncBytesRead $myCgi]

To be documented soon...

top
AsyncInProgress
boolean 1/0
set boolVal [CkCgi_get_AsyncInProgress $myCgi]

To be documented soon...

top
AsyncPostSize
integer
set intVal [CkCgi_get_AsyncPostSize $myCgi]

To be documented soon...

top
AsyncSuccess
boolean 1/0
set boolVal [CkCgi_get_AsyncSuccess $myCgi]

To be documented soon...

top
DebugLogFilePath
string
# ckStr is a CkString
CkCgi_get_DebugLogFilePath $myCgi $ckStr
set strVal [CkCgi_get_debugLogFilePath $myCgi]
CkCgi_put_DebugLogFilePath $myCgi $strVal

If set to a file path, causes each Chilkat method or property call to automatically append it's LastErrorText to the specified log file. The information is appended such that if a hang or crash occurs, it is possible to see the context in which the problem occurred, as well as a history of all Chilkat calls up to the point of the problem. The VerboseLogging property can be set to provide more detailed information.

This property is typically used for debugging the rare cases where a Chilkat method call hangs or generates an exception that halts program execution (i.e. crashes). A hang or crash should generally never happen. The typical causes of a hang are:

  1. a timeout related property was set to 0 to explicitly indicate that an infinite timeout is desired,
  2. the hang is actually a hang within an event callback (i.e. it is a hang within the application code), or
  3. there is an internal problem (bug) in the Chilkat code that causes the hang.

More Information and Examples
top
IdleTimeoutMs
integer
set intVal [CkCgi_get_IdleTimeoutMs $myCgi]
CkCgi_put_IdleTimeoutMs $myCgi $intVal

To be documented soon...

top
LastErrorHtml
string
# ckStr is a CkString
CkCgi_get_LastErrorHtml $myCgi $ckStr
set strVal [CkCgi_get_lastErrorHtml $myCgi]

Provides information in HTML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastErrorText
string
# ckStr is a CkString
CkCgi_get_LastErrorText $myCgi $ckStr
set strVal [CkCgi_get_lastErrorText $myCgi]

Provides information in plain-text format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastErrorXml
string
# ckStr is a CkString
CkCgi_get_LastErrorXml $myCgi $ckStr
set strVal [CkCgi_get_lastErrorXml $myCgi]

Provides information in XML format about the last method/property called. If a method call returns a value indicating failure, or behaves unexpectedly, examine this property to get more information.

top
LastMethodSuccess
boolean 1/0
set boolVal [CkCgi_get_LastMethodSuccess $myCgi]
CkCgi_put_LastMethodSuccess $myCgi $boolVal

Indicate whether the last method call succeeded or failed. A value of 1 indicates success, a value of 0 indicates failure. This property is automatically set for method calls. It is not modified by property accesses. The property is automatically set to indicate success for the following types of method calls:

  • Any method that returns a string.
  • Any method returning a Chilkat object, binary bytes, or a date/time.
  • Any method returning a standard boolean status value where success = 1 and failure = 0.
  • Any method returning an integer where failure is defined by a return value less than zero.

Note: Methods that do not fit the above requirements will always set this property equal to 1. For example, a method that returns no value (such as a "void" in C++) will technically always succeed.

top
NumParams
integer
set intVal [CkCgi_get_NumParams $myCgi]

To be documented soon...

top
NumUploadFiles
integer
set intVal [CkCgi_get_NumUploadFiles $myCgi]

To be documented soon...

top
ReadChunkSize
integer
set intVal [CkCgi_get_ReadChunkSize $myCgi]
CkCgi_put_ReadChunkSize $myCgi $intVal

To be documented soon...

top
SizeLimitKB
integer
set intVal [CkCgi_get_SizeLimitKB $myCgi]
CkCgi_put_SizeLimitKB $myCgi $intVal

To be documented soon...

top
StreamToUploadDir
boolean 1/0
set boolVal [CkCgi_get_StreamToUploadDir $myCgi]
CkCgi_put_StreamToUploadDir $myCgi $boolVal

To be documented soon...

top
UploadDir
string
# ckStr is a CkString
CkCgi_get_UploadDir $myCgi $ckStr
set strVal [CkCgi_get_uploadDir $myCgi]
CkCgi_put_UploadDir $myCgi $strVal

To be documented soon...

top
Utf8
boolean 1/0
set boolVal [CkCgi_get_Utf8 $myCgi]
CkCgi_put_Utf8 $myCgi $boolVal

When set to 1, all "const char *" arguments are interpreted as utf-8 strings. If set to 0 (the default), then "const char *" arguments are interpreted as ANSI strings. Also, when set to 1, and Chilkat method returning a "const char *" is returning the utf-8 representation. If set to 0, all "const char *" return values are ANSI strings.

top
VerboseLogging
boolean 1/0
set boolVal [CkCgi_get_VerboseLogging $myCgi]
CkCgi_put_VerboseLogging $myCgi $boolVal

If set to 1, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. The default value is 0. Verbose logging should only be used for debugging. The potentially large quantity of logged information may adversely affect peformance.

top
Version
string
# ckStr is a CkString
CkCgi_get_Version $myCgi $ckStr
set strVal [CkCgi_get_version $myCgi]

Version of the component/library, such as "9.5.0.94"

More Information and Examples
top

Methods

AbortAsync
CkCgi_AbortAsync

To be documented soon...

top
AsyncReadRequest
set retBool [CkCgi_AsyncReadRequest]

To be documented soon...

top
GetEnv
# varName is a string
# outStr is a CkString (output)
set status [CkCgi_GetEnv $varName $outStr]
set retStr [CkCgi_getEnv $myCgi $varName]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetParam
# paramName is a string
# outStr is a CkString (output)
set status [CkCgi_GetParam $paramName $outStr]
set retStr [CkCgi_getParam $myCgi $paramName]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetParamName
# index is an integer
# outStr is a CkString (output)
set status [CkCgi_GetParamName $index $outStr]
set retStr [CkCgi_getParamName $myCgi $index]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetParamValue
# index is an integer
# outStr is a CkString (output)
set status [CkCgi_GetParamValue $index $outStr]
set retStr [CkCgi_getParamValue $myCgi $index]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetRawPostData
# outData is a CkByteData (output)
set status [CkCgi_GetRawPostData $outData]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetUploadData
# index is an integer
# outData is a CkByteData (output)
set status [CkCgi_GetUploadData $index $outData]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetUploadFilename
# index is an integer
# outStr is a CkString (output)
set status [CkCgi_GetUploadFilename $index $outStr]
set retStr [CkCgi_getUploadFilename $myCgi $index]

To be documented soon...

Returns 1 for success, 0 for failure.

top
GetUploadSize
# index is an integer
set retInt [CkCgi_GetUploadSize $index]

To be documented soon...

top
IsGet
set retBool [CkCgi_IsGet]

To be documented soon...

top
IsHead
set retBool [CkCgi_IsHead]

To be documented soon...

top
IsPost
set retBool [CkCgi_IsPost]

To be documented soon...

top
IsUpload
set retBool [CkCgi_IsUpload]

To be documented soon...

top
ReadRequest
set retBool [CkCgi_ReadRequest]

To be documented soon...

top
SaveNthToUploadDir
# index is an integer
set retBool [CkCgi_SaveNthToUploadDir $index]

To be documented soon...

top
SleepMs
# millisec is an integer
CkCgi_SleepMs $millisec

To be documented soon...

top
TestConsumeAspUpload
# path is a string
set retBool [CkCgi_TestConsumeAspUpload $path]

To be documented soon...

top