Writing out Binary Data via CFScript
Hopefully someone will be able to provide some insight or possible resolution
On a site I'm now managing there is a piece of code that is being used to
write out binary data (images) to the client that are located on the HDD. This
code (after doing some searching) is verbatim from Christian Cantrell's blog
posting from about 5 years ago
As far as I can tell the end user is not experiencing any problems - but the
exception.log (as well as the application.log) is filling up with the following
(Hopefully the actual code in question is posted at the bottom of this message)
Of course if the end users are not getting an error this is fine, but it
doesn't reflect well on us when the client decides to look at the log files and
sees and endless stream of error messages related to this code.
I have tried using the reponse.reset(); in a couple of different locations
within that 'script' but this in turn generates teh following error:
java.lang.IllegalStateException: Response has already been committed
I've searched and read every possible link I could google and nothing else
seems to provide any insight on a solution.
The client is currently running CFMX 7.0.2 (no hot fixes) standard edition ...
which seems to be utilizing JRun Updater 5.
Thanks in advance for any possible insight or fix.
<cffile action="readbinary" file="#ipath#" variable="pic"/>
context = getPageContext();
response = context.getResponse().getResponse();
out = response.getOutputStream();