#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    1
    Rep Power
    0

    Question 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?

    <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. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,243
    Rep Power
    967
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Chicago, IL
    Posts
    4
    Rep Power
    0
    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.

IMN logo majestic logo threadwatch logo seochat tools logo