Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Compression > RadCompression and Zip file downloads

Not answered RadCompression and Zip file downloads

Feed from this thread
  • Dave avatar

    Posted on Nov 3, 2011 (permalink)

    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

    Reply

  • Martin Martin admin's avatar

    Posted on Nov 8, 2011 (permalink)

    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Compression > RadCompression and Zip file downloads