Name

BinaryRead — MySafeArray =Request.BinaryRead( ByteCount)

Synopsis

The BinaryRead method reads a number of bytes directly from the HTTP request body sent by the client as part of an HTTP Post. The data read from an HTTP request using the BinaryRead method is returned into a SafeArray. A SafeArray is a special variant array that contains, in addition to its items, the number of dimensions in the array and the upper bounds of the array.

Tip

In actuality, a SafeArray is not an array at all. It's a special type of structure used internally to maintain information held in its array portion. The dimensions and upper bounds values are available only from C/C++ as elements of the structure. You cannot manipulate these values (or even retrieve them) through script.

Parameters

MySafeArray

The name of a SafeArray used to store the information returned from a BinaryRead.

ByteCount

The number of bytes read using the BinaryRead method. Typically, this variable's value evaluates to the number of bytes returned using the TotalBytes property of the Request object described previously.

Example

<% ' The following code determines the total number of bytes ' sent in the client's HTTP request. It then reads the ' bytes, checks for errors, and if there are none, ' reports to the client that the read was successful. Dim lngTotalByteCount Dim vntRequestData On Error Resume Next lngTotalByteCount = Request.TotalBytes vntRequestData = Request.BinaryRead(lngTotalByteCount) If Err = 0 Then ' For details ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.