iis - ASP.NET/IIS6 - Disable chunked encoding when using dynamically compressed content? -
i'm running asp.net on iis6 server. right server set compress dynamically generated content, reduce page size of aspx files being retrieved.
once of aspx files has following bit of code, used fetch file database , send user:
response.clear(); response.buffer = true; response.contenttype = document.mimetype; response.addheader("content-disposition", "attachment;filename=\"" + document.filename + document.extension + "\""); response.addheader("content-length", document.filesizebytes.tostring()); byte[] docbinary = document.getbinary(); response.binarywrite(docbinary);
the download works perfectly. however, person downloading file doesn't progress bar, incredibly annoying.
from research i've been doing, seems when iis sets transfer-encoding chunked when compressing dynamic content, removes content-length header violates http1.1 standard when doing that.
what's best way around without turning dynamic compression off @ server level? there way through asp.net programatically turn off compression response? there better way go doing things?
you can turn on/off compression @ site or folder level modifying metabase. more information see:
scroll down to: "to enable http compression individual sites , site elements"
to need elevated rights (administrator @ least).
you might have place download page in it's own folder , turn off compression @ level not affect other parts of site.
i have admit i've not tried it's i'd attempt first.
Comments
Post a Comment