Wednesday, December 01, 2010

PDF freezing while loading

This happens with pdfs that were published with the fast webview option. (linearized) and having StaticFileHandler mapped to PDF files in the web.config file.

This issue occurs due to a problem with the StaticFileHandler while processing Ranged requests that have a buffer size greater than 16. The default range buffer size is 16. The Adobe PDF web browser plug-in uses Ranged HTTP requests and may send more than 16 ranged fragments for large .pdf files. In this scenario, the StaticFileHandler attempts to resize its buffer by calling the Buffer.BlockCopy function, which results in the web browser hanging and the download failing.


Remove the StaticFileHandler mapping from the web.config file so that the PDFs can be served via the DefaultHttpHandler.

No comments:

Post a Comment