|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I am trying to use cfhttp to return the contents of a compressed file (i.e. URL)
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? <cfhttp URL="#Server_URL#" method="post"> <CFHTTPPARAM TYPE="CGI" NAME="accept-encoding" VALUE="x-compress,uncompress" > </cfhttp> <CFOUTPUT> <H2><B><A href=#Server_URL#>#Server_URL#</A></B></H2><BR> #CFHTTP.FileContent# </CFOUTPUT> Thanks, Wes |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > cfhttp on compressed files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|