Menu
Feb 8, 2011 - That's easy to do for a ZIP file for example, but hard with a GIF or TXT. The reason is. Create FSO object to check if file exists and get properties. P.s.: Can I include your script in a “classic asp framework” that I'm coding? Example of creating a zip file with ASP and csASPZipFile. These pages show an example of using csASPZipFile to dynamically create a zip file on the server and stream it to the browser. The user can select files from a list and these will be collected and compressed into.
Re: How to compress multiple files with GZipStream and C#
May 25, 2009 04:16 AM|cheeso|LINK
The GZIP format is a standard, documented format. It does support putting multiple files into a single archive, however most GZIP tools produce a compressed (.gz) file that contains just one file. By convention, the root filename is the same, so that compressing Datafile.csv produces a file called Datafile.csv.gz.
![File File](/uploads/1/2/5/2/125244904/644138020.jpg)
The GZIP format is not the same as the .zip format. The GZipStream class can read or write files in the GZIP format, but the class does not produce or read .zip files, and the doc for the class clearly states this:
this class does not inherently provide functionality for adding files to or extracting files from .zip archives.
It is possible, with extra code, to produce or read a zip file, with the help of GZipStream, but it is not trivial.
If you want to read or write Zip files, the best bet is to use a third party library, like DotNetZip. This library is free, and enables your applications to read or write zip files that contain multiple compressed files. These are standard zip files that can be opened by Windows Explorer, or WinZip, or other zip tools. It's simple to use. It works with VB, or c#, or any .NET language
ZIP gzip