Why use deflate instead of gzip for text files served by Apache?

Why use deflate instead of gzip for text files served by Apache? The simple answer is don’t. RFC 2616 defines deflate as: deflate The “zlib” format defined in RFC 1950 in combination with the “deflate” compression mechanism described in RFC 1951 The zlib format is defined in RFC 1950 as : 0 1 +—+—+ |CMF|FLG| … Read more

Enable IIS7 gzip

Configuration You can enable GZIP compression entirely in your Web.config file. This is particularly useful if you’re on shared hosting and can’t configure IIS directly, or you want your config to carry between all environments you target. <system.webServer> <httpCompression directory=”%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files”> <scheme name=”gzip” dll=”%Windir%\system32\inetsrv\gzip.dll”/> <dynamicTypes> <add mimeType=”text/*” enabled=”true”/> <add mimeType=”message/*” enabled=”true”/> <add mimeType=”application/javascript” … Read more

Creating a ZIP archive in memory using System.IO.Compression

Thanks to ZipArchive creates invalid ZIP file, I got: using (var memoryStream = new MemoryStream()) { using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true)) { var demoFile = archive.CreateEntry(“foo.txt”); using (var entryStream = demoFile.Open()) using (var streamWriter = new StreamWriter(entryStream)) { streamWriter.Write(“Bar!”); } } using (var fileStream = new FileStream(@”C:\Temp\test.zip”, FileMode.Create)) { memoryStream.Seek(0, SeekOrigin.Begin); memoryStream.CopyTo(fileStream); … Read more

What is the difference between tar and zip? [closed]

tar in itself just bundles files together (the result is called a tarball), while zip applies compression as well. Usually you use gzip along with tar to compress the resulting tarball, thus achieving similar results as with zip. For reasonably large archives there are important differences though. A zip archive is a collection of compressed … Read more

What is a good Java library to zip/unzip files? [closed]

I know its late and there are lots of answers but this zip4j is one of the best libraries for zipping I have used. Its simple (no boiler code) and can easily handle password protected files. import net.lingala.zip4j.exception.ZipException; import net.lingala.zip4j.core.ZipFile; public static void unzip(){ String source = “some/compressed/file.zip”; String destination = “some/destination/folder”; String password = … Read more

How are zlib, gzip and zip related? What do they have in common and how are they different?

Short form: .zip is an archive format using, usually, the Deflate compression method. The .gz gzip format is for single files, also using the Deflate compression method. Often gzip is used in combination with tar to make a compressed archive format, .tar.gz. The zlib library provides Deflate compression and decompression code for use by zip, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)