webCOMAND

cTemplate Web Request Directives

There are a number directives to access HTTP web request information in cTemplate.

Example

#NEW($SuppressOutput)
    #* retrieve HTTP GET/POST parameter, file and cookie *#
    #NEW($Action)#GET('action')#ENDNEW
    #NEW($Filename)#GET('file')#ENDNEW
    #NEW($File)#GETFILE('file')#ENDNEW
    #NEW($Session)#GETCOOKIE('session')#ENDNEW

    #* get the uploaded file MIME Type *#
    #NEW($MimeType)#FILE(GetDataMimeType, $File)#ENDNEW

    #* send the file back to the browser *#
    #HEADER
Content-Type: $MimeType
Content-Disposition: attachment; filename="$Filename"
Content-Length: #SIZE($File)
    #ENDHEADER
    #ECHO($File)
#ENDNEW