I'm starting a CakePHP Helper based on phpqrcode. My problem is that i can't get the generated png or svg file and force the browser to download it.
i want to when a person submit his text via Ajax, i generate a QR Code for him and force the browser to download it without saving the file on the server.
Here is a short example of the Helper:
App::import('Vendor', 'QRGenerator.phpqrcode'.DS.'qrlib');
class QRHelper extends AppHelper{
function text($content= '') {
QRcode::png($content);
}
}
In my view file:
<?php $this->QR->text('example text'); ?>
And my layout:
<?php echo $this->fetch('content'); ?>
Thanks.