We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

caching of .zip files ? / zip files download as corrupted on IIS 7RSS

37 replies

Last post Jun 21, 2012 08:33 PM by qbernard

  • caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 21, 2010 04:45 PM|SGSMikeG|LINK

    Hi,

    I've just migrated a web site from Small Business Server 2003 to Small Business Server 2008 (running IIS7). 

    The web site has zip files available for download that are updated quite often.

     The problem is that people trying to download these zip files are now getting corrupted zips - often with the wrong file sizes.

    I suspect this may be some sort of caching issue.

    I've had the users clear their browser caches. In IIS I've added an entry to the Output Caching so that zips are not cached.  No luck.

     Any ideas ?

    Regards

    Michael

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 24, 2010 08:58 PM|steve schofield|LINK

    Have you tried this in Firefox, Chrome and IE with the same behavior?

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 24, 2010 09:40 PM|SGSMikeG|LINK

    Are you aware of something that is defective in IE  compared to Firefox etc in this area ?  The problem occurs in the latest Internet Explorer 8.....

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 24, 2010 09:44 PM|steve schofield|LINK

    Not that I'm aware of.  I've seen IE act funny in cases like this.

    Try - "Enable IE 7 compatibility mode in your browser"

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 24, 2010 10:33 PM|SGSMikeG|LINK

    Unfortunately the customer who reported this is on IE7.  I don't think this is 'just' a browser issue.  Any other ideas ?

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 24, 2010 11:05 PM|qbernard|LINK

    Well, have you tested other browsers? same? would be good to narrow down the issue if it is IE only. if all browser same issue, then might need to do a network sniff to figure it out. status code 200 for the request?

    Cheers,
    Bernard Cheah
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 24, 2010 11:13 PM|steve schofield|LINK

    I wonder if this is another victum of tcp chimney offloading.  :)  It would be good to test all browsers though.

    Here is more info on TCP Chimney off-load

    http://support.microsoft.com/kb/951037

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 25, 2010 02:22 AM|SGSMikeG|LINK

    The fact that the only change made was the migration from SBS 2003 to SBS 2008 would indicate the problem is server related - not a browser issue.  No changes were made to the web site itself at all.  And my other browser testing has shown the problem is server based.

    Under the IIS settings for the site I found a 'IIS' area called 'Compression'.  It has two settings :
     - Enable dynamic content compression
     - Enable static content compression

    Both were ticked by default.

    I disabled both and restarted the site.

    This seems to have solved the problem i.e. the browser will now download the zip uncorrupted.

    Do you know:
    1. Why are these settings enabled by default ?
    2. Why does the use of them corrupt a .ZIP file when downloaded over http ?

     

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 27, 2010 05:32 AM|steve schofield|LINK

    i can't speak to sbs 2008 default settings.  The default for dynamic compression in IIS is not enabled.   I've seen posts where IE downloads are corrupt and seem to be related to compression.  I'd suggest opening a case with MS if you have a contract or it's impacting your business.  They'll be able to help much more in your environment.

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 27, 2010 08:57 AM|qbernard|LINK

    Ya, by default static content compression is ON but not for dynamic content.
    so either open case with microsoft or see if you can find some useful information via network trace.

    Cheers,
    Bernard Cheah
  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 27, 2010 11:31 AM|Rovastar|LINK

     The IIS logs should give you more information.

    Look at the http status and substatus code AND the win32 error.

    If you can reproduce this behaviour in IE (or whatever) use 'fiddler'  to find out what is happening.

    Also is that *all* that has changed. Same IP/network configuration/routing/firewalls/etc for this new server? Just because the applciation has changed it doesn't mean nothing else has.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 27, 2010 06:28 PM|SGSMikeG|LINK

    I did nothing other than create a new site and copy the site from the old SBS2003 server.

    Therefore dynamic and static compression must have been set on by default. 

    Now given we are talking about a ZIP file here I assume the 'Static compression' setting is the one that is causing the troubles with the .ZIP download.

    Let me turn 'Dynamic compression' back on and see if the problem returns.

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 27, 2010 06:39 PM|SGSMikeG|LINK

    Interesting test results:

    'Enable Dynamic Compression'       'Enable Static Compression'   Zip download corrupts (Y/N)

     Y                                                Y                                           Y

    Y                                                 N                                           Y

    N                                                 Y                                           N

    N                                                 N                                           N

     

    So it would appear the 'Enable Dynamic Compression' is the problem i.e. corrupting .ZIP downloads.

    I would have thought a .ZIP file would have been regarded as static content.

    Corruption issue aside - have I misunderstood the definitions of dynamic version static content ?

     

     

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 01, 2010 08:19 PM|qbernard|LINK

    Mmm.. hard to tell. I think MS engineer would need to get the network packet captured and analyzed before they can tell you what's going on with dynamic content compression.

    Can you open a case with Microsoft support?

    Cheers,
    Bernard Cheah
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 03, 2010 03:17 AM|aryo_handono2000|LINK

    Funny,

    I've just experiencing similar problems when hosting a ZIP file in SBS 2008 for download purpose.

    Zip file size is only 24 MB, but when user click download link, it will download new zip file with total size 36MB.

    My 24MB zip file was zipped again automatically and rename without extension, so my user needs to do some extra effort for unzipping, adding zip extension, and unzipping to get the original files.

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 03, 2010 03:57 AM|SGSMikeG|LINK

    Yep  - that's the problem alright.

     What were your compression settings ?

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 05, 2010 10:13 AM|qbernard|LINK

    Ok.. let me see if I can get MS folks to look into this.

    Cheers,
    Bernard Cheah
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 05, 2010 01:42 PM|ksingla|LINK

    There are two questions here.

    1. Why dynamicCompression was turned on by default?
    2. Why zip files got dyamically compressed even though its a static file? I understand corruption was just that zip file got compressed again.

    Regarding 1, IIS7 don't have dynamic compression enabled by default. Only static compression is enabled. IIS7.5 ships with both static and dynamic compression enabled by default. I understand SBS2008 comes with Win2K8 (and not Win2K8 R2). So IIS should had dynamic compression disabled. I checked with SBS team if SBS2008 setup enable dynamic compression and they confirmed that they enable it. So this out of the way.

    Regarding 2, static compression only happens if request is handled by static file handler. Dynamic compression (if enabled) happens for both static and dynamic content if response qualifies for dynamic compression. You can choose mimeTypes for which dynamic compression will be attempted by controlling httpCompression/dynamicTypes collection. Mimetype for zip files is "application/x-zip-compressed". By default IIS doesn't enable dynamic compression for this mimeType. Did you enable dynamic compression for this mimeType? If SBS2008 enabled dynamic compression for this mimeType, we need to get this fixed in SBS. I am following up with SBS folks.

    Thanks,
    Kanwal

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 05, 2010 03:27 PM|ksingla|LINK

    SBS folks confirmed that they are not enabling compression for application/x-zip-compressed or application/* mimeType. Can you tell if you made any configuration changes after installing SBS2008 like enabling exchange cas role etc?

    Thanks,
    Kanwal

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 06, 2010 03:16 AM|SGSMikeG|LINK

    Hi,

    As far as I'm aware I didn't make any other configuration changes that could have affected this.  As mentioned previously to copy this public facing web site across from the old server I just created the same site on the new server and copied the web site files across - no special config because obviously I'm completely new to SBS2008 / IIS 7

    Regards

    Michael

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 03:29 AM|SGSMikeG|LINK

    Interesting follow-up - I've just built a new SBS2008 server for a customer i.e. not a migration.  Did the same thing - set up a new site in IIS 7 to host their single page public web site.  Guess what ?  Both dynamic and static compression were enabled by default........
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 06:47 AM|steve schofield|LINK

    Did you use a DVD / ISO manual install or do you guys have a scripted installation process? 

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 06:58 AM|SGSMikeG|LINK

    New SBS2008 install was done using OEM Microsoft SBS2008 DVD.  Previous igration of SBS2003 to a new SBS2008 server was done using the required XML based answer file - no way to do a migration without it.

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 10:29 AM|steve schofield|LINK

    I checked with a sbs2008 MVP, (susan bradley).  She mentioned WSUS was installed by default and can enable compression.  Can you double check that?

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 03:14 PM|SGSMikeG|LINK

    What do you want me to check ?  WSUS is installed by default with SBS2008.

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 07:49 PM|qbernard|LINK

    I'm back! errr... why are we spending time on which app or built got dynamic compress turned on by default? rather than checking why dynamic compression mess up the zip file download?

    Cheers,
    Bernard Cheah
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 09, 2010 08:25 PM|steve schofield|LINK

    at least they know how it gets turned on our suspect how using WSUS.  That is something our MS IIS person could check with the SBS 2008 folks.  That is step 1, the second is 'why' as you mentioned.  Turn dynamic compression off on the specific folder using a specially crafted web.config in the folder hosting zip files.

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Feb 11, 2010 12:40 AM|qbernard|LINK

    Errr, but why dynamic compression corrupt the zip file download?

    Cheers,
    Bernard Cheah
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Nov 03, 2010 01:47 PM|txs8311|LINK

    It gets corrupted because it's getting compressed twice (double zipped). To avoid this, and not have to turn off dynamic compression on folders that may contain zip files, edit the dynamicTypes element in the applicationHost.config file, adding an exclusion rule for zip content, e.g. <add mimeType="application/x-zip-compressed" enabled="false" />. An IISRestart is necessary after editing the .config file for the changes to go into effect.

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Nov 03, 2010 11:40 PM|qbernard|LINK

    Errr. zip should be static content right? as pointed out earlier.
    Cheers,
    Bernard Cheah
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 15, 2012 05:12 PM|JohnDempsey|LINK

    SGSMikeG

    Hi,

    I've just migrated a web site from Small Business Server 2003 to Small Business Server 2008 (running IIS7). 

    The web site has zip files available for download that are updated quite often.

     The problem is that people trying to download these zip files are now getting corrupted zips - often with the wrong file sizes.

    I suspect this may be some sort of caching issue.

    I've had the users clear their browser caches. In IIS I've added an entry to the Output Caching so that zips are not cached.  No luck.

     Any ideas ?

    Regards

    Michael

    Repairing zip file it's for [url=http://www.recoverytoolbox.com/restore_corrupt_zip_file.html]restore zip file[/url]. The program own all necessary facilities allowing to start any system requirements. The program demonstrates the results of restoring as a list.
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 15, 2012 09:47 PM|kctt|LINK

     johndempsey, the OP identified the problem is caused by compression setting in IIS.

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jan 17, 2012 10:09 AM|HCamper|LINK

    Hi johndempsey,

     "Recovery Toolbox for Zip - an efficient remedy for damaged zip files"

    The op does not need the tool

    Thanks for information.

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jun 04, 2012 02:20 PM|jinmors31|LINK

    You may solve problem out due to next utility [url=http://www.recoverytoolbox.com/repair_zip.html]zip file recovery[/url] it provides you restoring .zip file with saving its original structure before corruption Good Luck!
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jun 06, 2012 04:42 AM|pankaj.parmar|LINK

    Can somebody help me find these settings, I couldn't find it in my IE version 9, I am checking in advanced tab of IE.

     - Enable dynamic content compression
     - Enable static content compression

    Thanks,

    Pankaj

    http://support.jesoba.com

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jun 06, 2012 05:21 AM|steve schofield|LINK

    these two settings you mentioned are in Internet Manager, not IE.   Static Content is enabled by default when you install IIS.  Dynamic content is a role service you install extra if you want to.  I'd chk with your IIS admin to see if these are enabled.

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jun 17, 2012 07:44 PM|birbilis|LINK

    Have seen this thread referred to from http://forums.silverlight.net/t/185747.aspx/1

    Is there any chance IIS is playing it clever and unpacks the .zip to repack it with higher compression or something, thus probably firing Silverlight security checks for man-in-the-middle attacks against XAP packages? (ClickOnce has such, so maybe Silverlight has such too)

    George Birbilis <birbilis@kagi.com>
    Microsoft MVP J# 2004-2010
    Borland Spirit of Delphi 2001
    http://www.zoomicon.com
  • Re: caching of .zip files ? / zip files download as corrupted on IIS 7

    Jun 21, 2012 08:33 PM|qbernard|LINK

    Doubt so, though would be pretty nice to have.

    What kind of compress ratio we talking here?

    Cheers,
    Bernard Cheah