Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

HttpRequest::GetBufferlessInputStream Method

Gets a Stream object that can be used to read the incoming HTTP entity body.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
public:
Stream^ GetBufferlessInputStream()

Return Value

Type: System.IO::Stream
A Stream object that can be used to read the incoming HTTP entity body.
ExceptionCondition
HttpException

The request's entity body has already been loaded and parsed. Examples of properties that cause the entity body to be loaded and parsed include the following:

This method provides an alternative to using the InputStream property. The InputStream property waits until the whole request has been received before it returns a Stream object. In contrast, the GetBufferlessInputStream method returns the Stream object immediately. You can use the method to begin processing the entity body before the complete contents of the body have been received.

The entity body (or as much of it as you request and has been received) is returned only when you use the object that is returned by this method to read the stream, by calling methods such as the Read method. You use parameters of the Read method to specify how much of the entity body to read.

This method can be useful if the request is uploading a large file and you want to begin accessing the file contents before the upload is finished. However, you should only use this method for scenarios where you want to take over all processing of the entity body. This means that you cannot use this method from an .aspx page, because by the time an .aspx page runs, the entity body has already been read.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.