Jake Morgan recently submitted an article to Codeproject.com detailing how to deploy zip files to a web application and serve uncompressed files directly out of the zip file. We use this technique on Elsitech.com for our Developer Labs section. The full Codeproject.com article contains implementation discussion and the sample code needed.
From the article:
The ZipEntryHandler enumerates and serves files out of static zip files deployed in your web space. The handler is implemented as a simple ASP.NET IHttpHandler deployed with a code file in the App_Code directory on your website and configured with a line in the web.config file. The handler is very useful for several purposes:
- Serving otherwise prohibited files - Code files with extensions that have special meaning to the web application ("cs", "vb", "aspx") can be served statically.
- Storage Space - Very compressible content often consumes large amounts of web space. This handler allows content to be stored compressed without special access to the file system on a web server.
- Maintainability - Often a zip file and the contents of the zip file should both be downloadable and browsable. This pattern allows solely the zip file to be deployed without having to synchronize other downloads.