Had some issues yesterday whilst testing a web application we were upgrading to .NET 4.0 and IIS 7.0. The solution stores files in a database then writes then out to file using a Response.BinaryWrite and setting the content-length so the output is truncated at the correct length.
The solution worked perfectly under Visual Studio but as soon as we deployed to IIS 7.0 the entire response stream would be written to file and the content-length was being ignored. We tracked the issue down to IIS 7.0 having dynamic compression turned on by default. To fix the issue go to the IIS admin console, select the application and look for the compression icon in the features view, then disable dynamic compression. That fixes the issue until the code can be revisted.