#### BinaryRead

The BinaryRead method retrieves data sent to the server from the client as part of a POST request. This method retrieves the data from the client and stores it in a SafeArray. A SafeArray is an array that contains information about the number of dimensions and the bounds of its dimensions.

###### Syntax

variant = Request.BinaryRead(count)

###### Parameters

variant
  Contains an array of unsigned bytes returned by this method. This parameter will be of type VT_ARRAY | VT_UI1, which is a variant array of unsigned one byte characters.
count
  Before execution, specifies how many bytes to read from the client. After this method returns, count will contain the number of bytes successfully read from the client. The total number of bytes that will actually be read is less than or equal to Request.TotalBytes.

###### Remarks

The BinaryRead method is used to read the raw data sent by the client as part of a POST request. This method is used for low-level access to this data, as opposed to, for example, using the Request.Form collection to view form data sent in a POST request. Once you have called BinaryRead, referring to any variable in the Request.Form collection will cause an error. Conversely, once you have referred to a variable in the Request.Form collection, calling BinaryWrite will cause an error. Remember, if you access a variable in the Request collection without specifying which subcollection it belongs to, the Request.Form collection may be searched, bringing this rule into force.

###### Example

The following example uses the BinaryRead method to place the content of a request into a safe array.

    <%
      Dim vntPostedData, lngCount

      lngCount = Request.TotalBytes
      vntPostedData = Request.BinaryRead(lngCount)
    %>

###### Applies To

Request Object

###### See Also

TotalBytes, ClientCertificate, Cookies, Form, QueryString, ServerVariables

© 1997-2001 Microsoft Corporation. All rights reserved.