This is a migrated thread and some comments may be shown as answers.

RadCompression and Zip file downloads

1 Answer 96 Views
Compression
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 04 Nov 2011, 12:13 AM
We're using RadCompression in our project and I've run into a small snag.  On one of our pages, we download a Zip file to the client.  We're using pretty standard code to download the file (similar to the following:  link), but the resulting file on the client is always coming up as corrupted.  I've verified that the source file on the server is good. 

After digging around a little, I tried disabling the EnablePostbackCompression setting in the web.config.  Now, the downloads are just fine.  So, is there a way to turn this setting off for a specific postback?  Or is there a better way to have both postback compression and the ability to download zip files?  Any help is appreciated!

Dave

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 08 Nov 2011, 05:40 PM
Hello Dave,

The described behavior is expected due to the fact that you have enabled RadCompression for postbacks, thus the page's response will pass through the RadCompression's module even when a full postback occurs. Therefore you should either disable the compression for postbacks (leaving it for ajax requests) (code snippet 1) or disable the compression for the page in question at all (code snippet 2). Both those approaches can be achieved by decorating the page's class with RadCompressionSettings attribute similar to the following:

[RadCompressionSettings(EnablePostbackCompression = false)] 
public partial class Defaults : System.Web.UI.Page 
}

OR

[RadCompressionSettings(HttpCompression = CompressionType.None)] 
public partial class Defaults : System.Web.UI.Page 
}

I hope this helps.

All the best,
Martin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Compression
Asked by
Dave
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or