Request.BinaryRead(count)

W

Water Cooler v2

Just trying to experiment with the Request.BinaryRead(count) method.
What's wrong with this script?

<SCRIPT Language="VBScript" runat="server">

Dim b
b = Request.BinaryRead(Request.TotalBytes)
Dim Counter

If IsArray(b) Then
If Not IsEmpty(b) Then
Response.Write(LBound(b) & ", " & UBound(b))
'For Counter = LBound(b) To UBound(b)
' Response.Write(CStr(b(Counter)))
'Next
End If
End If

</SCRIPT>
 
B

Bob Barrows [MVP]

Water said:
Just trying to experiment with the Request.BinaryRead(count) method.
What's wrong with this script?

What are we looking for? What makes you think something is wrong with it?
Symptoms? error messages?
 
A

Anthony Jones

Water Cooler v2 said:
Just trying to experiment with the Request.BinaryRead(count) method.
What's wrong with this script?

<SCRIPT Language="VBScript" runat="server">

Dim b
b = Request.BinaryRead(Request.TotalBytes)
Dim Counter

If IsArray(b) Then
If Not IsEmpty(b) Then
Response.Write(LBound(b) & ", " & UBound(b))
'For Counter = LBound(b) To UBound(b)
' Response.Write(CStr(b(Counter)))
'Next
End If
End If

</SCRIPT>

If TotalBytes = 0 then b contains a variant marked as an Array but the
pointer to the array is null.
Since it is an array it isn't empty.
Using LBound ot UBound on an undimensioned array results in a subscript out
of range error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top