Microsoft KB Archive/278998

= How to enable chunked transfer encoding with IIS =

Article ID: 278998

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Services 5.0
 * Microsoft Internet Information Services 5.1
 * Microsoft Internet Information Services 6.0

-



This article was previously published under Q278998



IN THIS TASK

 * SUMMARY
 * Enable Chunked Transfer Encoding
 * Send Chunked Data in ISAPI Programming
 * REFERENCES



SUMMARY
This article describes how to enable chunked transfer encoding with Internet Information Services (IIS).

The HTTP specification does not provide a way to guarantee reliable transmission of replies. The HTTP 1.1 specification adds transfer encoding as a way to make it possible to safely transport messages that are sent through HTTP (see RFC 2068). &quot;Chunked&quot; is a type of transfer encoding by which the message body is transmitted to the client as chunks that are stamped with the size of the chunks (see section 14.40 of RFC 2068). With chunked transfer encoding, the client can make sure that it has received all of the data that the server sends.

Chunked transfer encoding is similar to MIME encoding in relation to Internet mail (see RFC 822). The specific differences between MIME encoding and chunked transfer encoding are discussed in section 19.4 of RFC 2068.

back to the top

Enable Chunked Transfer Encoding
To enable chunked transfer encoding, set the value for AspEnableChunkedEncoding to True in the metabase for the site, the server, or the virtual directory that you want to enable chunked transfer encoding for. By default, the value is True, and it is set at the Web service level. To set this property in the metabase:  Open a command prompt. Change to the Inetpub\Adminscripts folder. Run the following:

cscript adsutil.vbs set /W3SVC/AspEnableChunkedEncoding &quot;TRUE&quot;



For more information, visit the following MSDN Web site:

AspEnableChunkedEncoding

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/f2440a37-0cf7-45c6-85e0-d0c8d1433e33.asp

back to the top

Send Chunked Data in ISAPI Programming
In Internet Server Application Programming Interface (ISAPI) programming, if you want to send chunked data, add a &quot;Transfer-Encoding: chunked&quot; header, and then send the correctly formatted chunked stream by using InternetWriteFile: POST / HTTP/1.1 Host: x.x.x.x:port Connection: keep-alive TRANSFER-ENCODING: chunked back to the top

