<div>
Hi all,
</div><div><br></div><div>If I've got a scalar $data containing some binary data (a JPG image read using read_file($file, binmode => ':raw' ), how can I cause one of my routes to output it?</div><div><br></div><div>I've done essentially this (simplified):</div><div><br></div><div>get '/some/route' => sub {</div><div> my $data = …get_image…;</div><div><br></div><div> header 'Content-Type' => 'image/jpeg';</div><div> return $data;</div><div>}</div><div><br></div><div>but this doesn't feel right and causes a broken output (appears to return only a few rows of pixels of the image). </div><div><br></div><div>Any tips?</div><div><br></div><div>Cheers</div>
<div><div><br></div><div>-- </div><div>Rik Brown</div><div>http://www.rikbrown.co.uk</div><div><br></div></div>