March 10th, 2004, 12:56 PM
cfhttp on compressed files
I am trying to use cfhttp to return the contents of a compressed file (i.e. http://testserv.wes.gov:2000/Coldfus...ecutive.log.gz)
This is the code I am using, but it doesn't return the uncompressed results. Instead it returns garbled characters. The accept-encoding is documented at w3c, but I suspect I don't have the correct value for the .gz file type. Anyone have experience with this?
<CFHTTPPARAM TYPE="CGI" NAME="accept-encoding" VALUE="x-compress,uncompress" >
March 10th, 2004, 07:39 PM
If you mean can CF read that file AND then uncompress it, I don't believe so (not without going into the Java API or using a custom tag). If you just want to grab it as a file, try using getasbinary="yes" in your cfhttp call.
April 6th, 2004, 12:42 PM
Using the compress/uncompress header is to gzip the text file for the browser, to squish down the file size for transmitting, not to uncompress data on the fly.
You will have to do a <CFEXECUTE> ungzip, and then return that as your data.