|
The BinaryRead method reads information sent from the client to the server as part of a POST request. The data is returned as a SafeArray that contains information about the dimensions of the array.
variant = Request.BinaryRead(count)
variant
An array of unsigned bytes returned by this method.
count
Before the read, the number of bytes to read from the client. After execution, the actual number of bytes successfully read from the client. The number of bytes that will be read is less than or equal to Request.TotalBytes.
The BinaryRead method is used to read the raw data sent by a POST request. This provides low-level access as opposed to the formatted data provided by the Request.Form collection. Once you have used the BinaryRead method, any call to a variable in the Request.Form collection will cause an error. Conversely, calling BinaryRead after accessing the Request.Form collection will also cause an error. Remember, if you access a variable in the Request object without specifying a collection, the Request.Form collection may be accessed, bringing this rule into force.
The following example uses the BinaryRead method to place the contents of a Request object into a safe array.
<%
dim bytecount
dim binread
bytecount = Request.TotalBytes
binread = Request.BinaryRead(bytecount)
%>
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.