Try something like this: <cfcontent type="text/html" variable="#fileout.toByteArray()#">
Not sure if text/html is right, but you want binary data, not string data. Mark On 9/12/06, Andrew Scott <[EMAIL PROTECTED]> wrote: > > > > > Ok I thought I was onto a beginning here by getting coldfusion to compress > the content, and then redisplay it. In its basic form this will only do text > at this stage, but it is a start. > > > > Anyway I hit a snag, I can not for the life of me get the browser to deflate > the string. Anyone see the problem at all, I have tried many combinations of > the cfcontent and cfheader but not the right one by the looks of it. > > <cffunction name="onRequestEnd" returntype="boolean" > output="true"> > > <cfargument name="thePage" type="string" > required="true"> > > <cfset var myString ="Andrew was here in 2006" /> > > <cfset var fileOut = '' /> > > <cfset var out = '' /> > > <cfscript> > > pageOut = > getPageContext().getCFOutput().getString(); > > </cfscript> > > <cfscript> > > fileOut = > createobject("java", "java.io.ByteArrayOutputStream").init(); > > out = > createobject("java","java.util.zip.GZIPOutputStream").init(fileOut); > > out.write(variables.pageOut.getBytes(), 0, > len(variables.pageOut.getBytes())); > > // Complete the GZIP > file > > out.finish(); > > out.close(); > > </cfscript> > > <cfheader name="Content-Length" > value="#fileOut.toString().length()#"> > > <cfcontent type="text/html; charset=UTF-8" > reset="yes"> > > <cfheader name="Content-Encoding" value="gzip"> > > > <cfoutput>#fileOut.toString()#</cfoutput> > > <cfreturn true /> > > </cffunction> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~---