gzip

Multi-part gzip file random access (in Java)

This may fall in the realm of "not really feasible" or "not really worth the effort" but here goes. I'm trying to randomly access records stored inside a multi-part gzip file. Specifically, the files I'm interested in are compressed Heretrix Arc files. (In case you aren't familiar with multi-part gzip files, the gzip spec allows multipl...

Unpack large files with gzip in PHP

I'm using a simple unzip function (as seen below) for my files so I don't have to unzip files manually before they are processed further. function uncompress($srcName, $dstName) { $string = implode("", gzfile($srcName)); $fp = fopen($dstName, "w"); fwrite($fp, $string, strlen($string)); fclose($fp); } The problem is th...

Is it possible to load gzip compressed javascript without a webserver?

I have been trying, unsuccessfully, to get a HTML page to load an external GZIP compressed javascript file from the local filesystem using a HTML file such as this: <html> <head> <script src="test.js.gz" type="text/javascript"></script> </head> <body></body> </html> When I open this HTML file directly in a browser, the Javascript file...

SOAPMessage GZIP implementation

I want to implement GZIP for SOAPMessage. Below is normal SOAP client call code - // Create a new SOAP message from the factory and set the SOAPAction header. MessageFactoryImpl factory = new MessageFactoryImpl(); SOAPMessage soapMsg = factory.createMessage(); // Set the SOAP envelope contents to our ebXML DOM. SO...

Access a large file in a zip archive with HTML in a python-webkit WebView without extracting

I apologize for any confusion from the question title. It's kind of a complex situation with components that are new to me so I'm unsure of how to describe it succinctly. I have some xml data and an image in an archive (zip in this case, but could easily be tar or tar.gz) and using python, gtk, and webkit, place the image in a webkit.We...

How can I make my .htaccess file allow Safari & other browsers to open GZIP?

I'm using an .htaccess file to allow my pages to call gzipped JavaScript files. It works fine in ie8 & ff3, but the script is not loaded in Safari (or Chrome). Here is the .htaccess file I'm using: <files *.js.gz> ForceType text/javascript Header set Content-Encoding: gzip </files> Then, for example, I can call JS files from my HTML...

How do I make .htaccess check if newer file exists?

Currently what I have in my .htaccess file is this, RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule ^(.*).(css|js)$ /$1.$2.gz My CSS and Javascript files have a number next to them such as example01.css and whenever I update them, I increase the number. Each time I do, I also have to update m...

How does server side GZipping work?

You might know that HTML related file formats are compressed using GZip compression, server side, (by mod_gzip on Apache servers), and are decompressed by compatible browsers. ("content encoding") Does this only work for HTML/XML files? Lets say my PHP/Perl file generates some simple comma delimited data, and sends that to the browser, ...

find string inside a gzipped file in a folder

My current problem is that I have around 10 folders, which contain gzipped files (around on an average 5 each). This makes it 50 files to open and look at. Is there a simpler method to find out if a gzipped file inside a folder has a particular pattern or not? zcat ABC/myzippedfile1.txt.gz | grep "pattern match" zcat ABC/myzippedfile2....

GZipping Content and FireFox

Hello, I recently came across this blog post which basically says that we should not GZip content before it is sent to FireFox. The reason why is because FireFox performs poorly with GZipped content. I was very surprised to hear this. Does anyone know if there is any validity to this blog post? ...

PHP's gzuncompress function in Java?

I'm compressing a string using PHP's gzcompress() function: http://us2.php.net/manual/en/function.gzcompress.php I'd like to take the output from the PHP compression function and decompress the string in Java. Can anyone send me down the right path? Thanks so much! ...

How can I compare file list from a tar archive and directory?

I am still learning Perl. Can anyone please suggest me the Perl code to compare files from .tar.gz and a directory path. Let's say I have tar.gz backup of following directory path which I have taken few days back. a/file1 a/file2 a/file3 a/b/file4 a/b/file5 a/c/file5 a/b/d/file and so on.. Now I want to compare files and directories ...

Can I uncompress .NET GZipStream using zlib?

Can I uncompress a bytestream that was compressed using the .NET GZipStream using the zlib library in C++? ...

What is a good setting for noCompressionUserAgents in Tomcat?

Googling for "noCompressionUserAgents" ends up with the same boilerplate config that seems to have been copied around and yet is not very useful (and even is here on stackoverflow:) stackoverflow.com/questions/550024/tomcat-compression-does-not-add-a-content-encoding-gzip-in-the-header noCompressionUserAgents="gozilla, traviat...

Reasons why gzipped content might not be grokked by the browser

I'm attempting to serve static resources (css and javascript) as cached gzipped files for performance reasons. The pages look gzipped when rendered, the Content-Encoding is correctly set to gzip according to LiveHTTPHeaders, and most importantly, the gzipped content is passing the GIDZipTest page (http://www.gidnetwork.com/tools/gzip-te...

Downloading compressed content over HTTP using Python

How do I take advantage of HTTP 1.1's compression when downloading web pages using Python? I am currently using the built-in urllib module for downloading web content. Reading through the documentation I couldn't find any information that is indeed using compression. Is it already built-in into urllib or is there another library that ...

Setting the gzip compression in asp.net

Is there a way to set the gzip compression at the web.config level or can I only do this in the IIS management console? ...

How to retrieve data from a attached zip file in Blackberry application?

I am using eclipse to build application for Blackberry. I attached a zip file with my application. Please help me, I don't know how to retrieve data form the zip file in application development. ...

programmatically extract tar.gz in a single step (on windows with 7zip)

PROBLEM: I would like to be able to extract tar.gz files in a single step. This makes my question almost identical to this one: stackoverflow question for tar-gz. My question is almost the same, but not the same, because I would like to do this on windows using 7zip command-line (or something similar) inside a bat file or ruby/perl/pyt...

How to decompress Gzip string in ruby?

Zlib::GzipReader can take "an IO, or -IO-lie, object." as it's input, as stated in docs. Zlib::GzipReader.open('hoge.gz') {|gz| print gz.read } File.open('hoge.gz') do |f| gz = Zlib::GzipReader.new(f) print gz.read gz.close end How should I ungzip a string? ...