Thursday, February 21, 2008

Problems with ZIP compression in IIS

When you download a .ZIP file from a Microsoft Windows SharePoint Services Document library, and try to open that file, you may encounter the following error message:

Cannot open file: it does not appear to be a valid archive. If you downloaded this file, try downloading the file again.

You may face this problem if HTTP compression has been turned on in the Web Sites properties of Microsoft Internet Information Services (IIS) on the SharePoint virtual server. When you download a .ZIP file, IIS may encode the file as GZIP (GNU Zip).

The browser client passes the file directly to the unzip program, with GZIP not decoding the file. You need to check if HTTP compression has been turned on. To check this:
  1. Click on Start, press Administrative Tools, and then click on Internet Information Services (IIS) Manager.
  2. Expand the server (local computer) tree, where server (local computer) is the name of your IIS server.
  3. Right-click on Web Sites, and then click Properties.
  4. Click the Service tab to view the HTTP compression properties.
To solve this problem, you need to modify MIME (Multipurpose Internet Mail Extensions) type for the .ZIP file from application/x-zip-compressed to the application/oclet-stream. To modify MIME type, please follow these steps:
  1. Click on Start, point to Administrative Tools, and then click on Internet Information Services (IIS) Manager.
  2. Right-click on the server (local computer) tree, where server (local computer) is the name of your IIS server, and then click on Properties.
  3. Click on MIME Types.
  4. Scroll down to the registered MIME type list to find the .zip entry.
  5. Click on the .zip application/x-zip-compressed entry, and then click Edit.
  6. Modify the MIME type value to application/octet-stream.
  7. Then Stop and then restart the IIS Admin Service to apply the change to the MIME type.
You will be able to overcome this problem after following these steps. If you still face this problem the .ZIP files may have been corrupted or damaged. You will not be able to open or access them and will need ZIP recovery software.

The software will help you to repair and recover corrupted .ZIP files. It will also help you to repair corrupted .ZIP files in case of a virus attack, unexpected system shutdown or a media read error. ZIP Repair software scans the damaged files and restores damaged .ZIP files to their original state. It can help you in all the above mentioned scenarios to recover your corrupted .ZIP files.