Hi, Christian Cantrell posted this on this blog. (
http://www.markme.com/cantrell/archives/002658.cfm)
Very handy.
This could be from a query or pretty much any query type source...
<cffile action="readbinary" file="/home/cantrell/Pictures/Corrs2.jpg" variable="pic"/>
This 'could' be reduced...why not experiment?
<cfscript>
context = getPageContext();
context.setFlushOutput(false);
response = context.getResponse().getResponse();
out = response.getOutputStream();
response.setContentType("image/jpeg");
response.setContentLength(arrayLen(pic));
out.write(pic);
out.flush();
out.close();
</cfscript>
It just takes some minor changes to change the content disposition and have the file 'download' to the client.
br00n