CGIParameterData()

Syntax

*Result = CGIParameterData(Name$ [, Index])
Description
Returns the memory buffer address of the specified parameter data.

Parameters

Name$ The name of the parameter to get the type. The parameter name is case-sensitive. CGIParameterName() can be used to get the name of a specified parameter. To get the number of available parameters, use CountCGIParameters().
Index (optional) The index of the parameter to get the type. The first index value starts from 0. If specified, the 'Name$' parameter value is ignored (excepts if sets to #PB_Ignore).

Return value

Returns the memory buffer address of the specified parameter data. The parameter type has to be #PB_CGI_File. CGIParameterDataSize() can be used to get the size of the memory buffer.

Example

  If Not InitCGI() Or Not ReadCGI()
    End
  EndIf
  
  WriteCGIHeader(#PB_CGI_HeaderContentType, "text/html", #PB_CGI_LastHeader) ; Write the headers to inform the browser of the content format
  
  WriteCGIString("<html><title>PureBasic - parameters</title><body>" +
                 "NbParameters: " + CountCGIParameters() + "<br><br>")
  
  ; List the all parameters and display their name
  ;
  For k = 0 To CountCGIParameters()-1
    If CGIParameterType("", k) = #PB_CGI_File
      WriteCGIString("[File] "+CGIParameterName(k)+" (filename: '"+CGIParameterValue("", k) +
                                                   "' - size: " + CGIParameterDataSize("", k) + 
                                                   " bytes - *buffer: " + CGIParameterData("", k) + ")<br>")
    EndIf
  Next
  
  WriteCGIString("</body></html>")

See Also

CGIParameterName(), CGIParameterValue(), CGIParameterType(), CGIParameterDataSize()

Supported OS

All

<- CGICookieValue() - CGI Index - CGIParameterDataSize() ->