CGIParameterDataSize()

Syntax

Result = CGIParameterDataSize(Name$ [, Index])
Description
Returns the size of the specified parameter data size.

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 data size (in bytes) of the specified parameter. CGIParameterData() can be used to get the memory buffer address of the parameter. The parameter type has to be #PB_CGI_File.

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(), CGIParameterData()

Supported OS

All

<- CGIParameterData() - CGI Index - CGIParameterName() ->