function showFile($order_id = 0, $fid = 0) { require_once JPATH_COMPONENT . DS . 'assets' . DS . 'export_helper.php'; $ehelper = new OnepageTemplateHelper($order_id); $order_id = JRequest::getVar('orderid'); $fid = JRequest::getVar('fid'); $ehelper->showFile($order_id, $fid); /* @ob_get_clean();@ob_get_clean();@ob_get_clean();@ob_get_clean();@ob_get_clean(); // autorization should be here! $ehelper = new OnepageTemplateHelper(); $data = $ehelper->getExportItemFile($fid); if (!empty($data)) { $pdf = urldecode($data['path']); if (file_exists($pdf)) { $pi = pathinfo($pdf); $filename = $pi['basename']; header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="'.$filename.'"'); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past readfile($pdf); die(); } } die('Cannot find the requested file!'); */ }