gzip

tmpfile and gzip combination problem

I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0) f = gzip.GzipFile(mode='rb', fileobj=file) print f.read() I dont know why it doesn't print out anything. If I uncomment file.seek then error occurs: File "/usr/lib/python2.5/gzip.py"...

Requesting a GZIP'ed page and processing with cURL and PHP

I'd like to make a cURL request that accepts a gzip'ed page. I would then like to unzip the page and process it. I haven't been able to find any ready built examples, so I would like a quick one. Any settings that need to be adjusted, making the actual request, and decompressing the contents. ...

Script to change the compression of gziped files

I was trying to change the compression of some gzip files from the default compression level (6) or any other compression level to the maximum compression level (9). Does anyone know how? ...

Data decompression on iPhone with gZip

Hello friends, I am using socket connection to get data from the server. Socket stream is compressed with gzip format. Now at iPhone side I am using this code to decompress it. But unfortunately I am getting Null string. Actually Data is compressed and then encoded. I am decoding my data and then trying to decompress it. (I have veri...

Gzip http compression problem on iis7

My web hosting provider is running IIS7 and I am having loads of trouble to get gzip compression to work properly. Host admins say compression is installed. I can confirm compression using some online checking services but not with others. PageSpeed Firefox add-on also says the site is uncompressed. I am personally sitting behind a Squid...

Accept-Encoding headers being sent by browser but not received by server

I have been trying to debug this for weeks. All of the browsers on all of the clients on my home network are sending 'Accept-Encoding: gzip,deflate'. However, that header is somehow, somewhere being dropped before the request makes it to a web server. For example, http://www.whatsmyip.org/http_compression/ says 'No, your browser is not r...

ASP.NET JavaScript File Embeded In DLL With GZIP

We have several fairly large JavaScript files embedded into a single script resources DLL. This is then consumed by multiple projects by way of a reference and page includes via the ASP.NET script manager. This keeps things nice and neat within our ASP.NET pages and requires very little work to integrate into new projects. The problem i...

Compress file to bytes for uploading to SQL Server

I am trying to zip files to an SQL Server database table. I can't ensure that the user of the tool has write priveledges on the source file folder so I want to load the file into memory, compress it to an array of bytes and insert it into my database. This below does not work. class ZipFileToSql { public event MessageHandler Messa...

Reversing the effects of mkimage to get an original gzipped file back

Hello, We develop for a specific embedded device at our company, and part of that is making initial root disks that get loaded onto the devices over ethernet via netboot. We've experienced some problems, and as a result, the original folder with the contents of the initial root disks was lost along with its backups, but we do still hav...

Using both chunked transfer encoding and gzip

I recently started using gzip on my site and it worked like a charm on all browsers except Opera which gives an error saying it can not decompress the content due to damaged data. From what I can gather from testing and googling it might be a problem with using both gzip and chunked transfer encoding. The fact that there is no error when...

How to GZIP my JS und CSS Files

Hello everyone, I habe a Problem, I have to gzip a prototype Lib, but i totaly have no idea how to do this, where to start und how does it works :) I find some tutorials but that wasn't helpfull... So I have a folder with my JS Files /compressed/js/ 1.js 2.js 3.js I caling this files for a test in this file /compresses/index.php <...

Damaged data when gzipping

This is the script I have written for gzipping content on my site, which is located in 'gzip.php'. The way I use it is that on pages where I want to enable gzipping I include the file at the top and at the bottom I call the output function like this: print_gzipped_page('javascript') If the file is a css-file I use 'css' as the $type-a...

Is it possible to import .gzip file into sqlite / Could I skip some column while importing ?

I tried to play around with .import but it seems to limited with csv and delimited file. Is it possible to import gzip file ? or at least, pipe from command line ? Also, could I skip some un-wanted column like mysql "LOAD DATA INFILE" ? ...

Do most shared hosts handle gzipped files?

I get them theoretically, but I'm grappling with gzipping files in practice. How should I go about gzip compressing my files, and what needs to be done in order to use them on a shared host? Would the following work? RewriteEngine On RewriteBase / RewriteCond %{HTTP:Accept-Encoding} .*gzip.* RewriteRule ^/(.*)\.js$ /$1.js.gz [L] Rewrit...

NSURLConnection/NSURLRequest gzip support!

Hi everyone! Does anyone knows if NSURLConnection/NSURLRequest have support for gzip requests. If does, can you provide more information? Thanks in advance! ...

Deflate zlib vs. Gzip compression on apache ... how to enable.

I've read on a couple of blogs, notably here http://www.codinghorror.com/blog/2008/10/youre-reading-the-worlds-most-dangerous-programming-blog.html there are some advantages to using deflate zlib compression by comparisson to gzip one. I am trying to setup apache to only do deflate so I can run some tests. However, I am having difficult...

searching within a compressed sorted fixed width file

Assume I have a regular fixed width file that is sorted on one of the fields. Given that I know the length of the records, I can use lseek to implement a binary search to find records with fields that match a given value without having to read the entire file. Now the difficulty is that the file is gzipped. Is it possible to do this wi...

Check the total content size of a tar gz file

How can I extract the size of the total uncompressed file data in a .tar.gz file? ...

Disabling compression for IE pre SP2 with Apache mod_rewrite

I am trying to replicate this fix ( http://sebduggan.com/posts/ie6-gzip-bug-solved-using-isapi-rewrite ) with Apache mod_rewrite, but with no success... Can somebody help me translate those ISAPI rules to APACHE mod_rewrite? I don't know how to 'translate' those rules... My objective is to avoid sending compressed css and js when the us...

Python line file iteration and strange characters

I have a huge gzipped text file which I need to read, line by line. I go with the following: for i, line in enumerate(codecs.getreader('utf-8')(gzip.open('file.gz'))): print i, line At some point late in the file, the python output diverges from the file. This is because lines are getting broken due to weird special characters tha...