Instead of the cfsilent why not just reset whats being outputted...

<!--- as much whitespace as you want can be put here --->
<CFFILE action="READ"  file="C:\CFusionMX\wwwroot\test\myGif.gif"
variable="gifFile">

<CFCONTENT TYPE="image/gif"
RESET="Yes"><cfoutput>#gifFile#</cfoutput><CFABORT>


HTH

Mikey



-----Original Message-----
From: Claude Schneegans [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 5, 2003 22:13
To: CF-Talk
Subject: Re: Sending binary directly to the browser?


>>Christian Cantrell blogged an example of doing this here:

Actually, after lots of reading and testing, I came to the conclusion that
all this is complicated for nothing.

This simple code works fine under CF 6:

<cfsilent>
<CFCONTENT TYPE="image/gif">
<CFFILE action="READ"  file="C:\CFusionMX\wwwroot\test\myGif.gif"
 variable="gifFile">
</cfsilent><cfoutput>#gifFile#</cfoutput>

The CFSILENT seems to be necessary, but
<cfsetting showdebugoutput="No" /> is not

This also works:
<cfsilent>
<CFCONTENT TYPE="image/gif">
<CFFILE action="READBINARY"  file="C:\CFusionMX\wwwroot\test\myGif.gif"
 variable="gifFile"> </cfsilent><cfoutput>#ToString(gifFile)#</cfoutput>

None of these work unde CF 5, under CF 4.x I don't know.

What happens is simply that they manage to fix the problem of toString()
refusing to insert zero bytes in the string, and <CFOUTPUT refusion to
output a string containing zero bytes, PERIOD.

There is still the problem that chr(0) returns an empty string instead of a
one byte string containing zero like it should. But now, we can work on the
binary content as an array, so we don't need string concatanation any more.

... still looking for a work around for CF 5 ;-)



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to