June 2002
Intermediate to advanced
816 pages
28h 12m
English
TotalBytes
intvar = Request.TotalBytes
Returns an Integer representing the size of the HTTP request body. The TotalBytes property does not include the size of the HTTP request headers, or the size of query string values passed with a GET request.
intvar
An Integer variable to receive the size, in bytes, of the current request body.
The example writes the TotalBytes property to the browser:
Sub Page_Load( ) Dim intvar As Integer intvar = Request.TotalBytes Message.Text = "The size of the current request body is: <br/>" Message.Text &= intvar & " bytes." End Sub
The following code can be used to post to the example page:
<html>
<head>
<title>Submit a named parameter via POST</title>
</head>
<body>
<form id="form1" action="TotalBytes.aspx" method="POST">
<h3>Name:</h3>
<input type="text" name="name">
<input type="submit">
</form>
</body>
</html>This property’s behavior is identical to that of the ContentLength property described earlier in this chapter.
Read now
Unlock full access