METHOD:  Request.BinaryRead

Request.BinaryRead(Count)

The BinaryRead method retrieves the unparsed data that was sent to the server from the user as part of an HTTP POST (i.e. an HTML FORM request). The data read is stored in a SafeArray which is a variant, structure-like array that, in addition to storing the data, also stores the number of dimensions of the array and the upper bounds of those dimensions.

You can write binary data into the response stream (info sent to a client) by using the Response.BinaryWrite(BinaryData) method. The BinaryData argument is simply the output (the SafeArray) from Request.BinaryRead. For example, you could retrieve an image from a database with Request.BinaryRead and send it to a client using Response.BinaryWrite.

Using Request.Form after calling BinaryRead, and vice-versa, will cause an error.

There is one mandatory argument.

Count

Before the method is executed, Count contains the number of bytes to be read. After the method has returned, Count contains the actual number of bytes read. The number read should be less than or equal to the total byte count value returned by Request.TotalByte.

Code:
<%
Dim ByteCount, BinRead
ByteCount = Request.TotalBytes
BinRead = Request.BinaryRead(ByteCount)
...
Response.BinaryWrite(BinRead)
%>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information