// PDF ///////////////////////////////////////////////////////////// $file = rwmb_meta( 'PRODUCT_pdf_file', '' , $post->ID); if(!empty($file)) { echo "<tr><td class = 'title' style = 'padding:10px;'>Product sheet</td></tr>"; echo "<tr><td style = 'padding:10px;'>"; $file = str_replace("www" , "dl" , $file); $url = "http://www.qcsasia.com/qcs-admin/action/downloadFile.php?link=" . $file; $filename = truncateFilename(getNameFromFile($file)); if (!isset($_SESSION['qcs-isconnect'])) { $file = "/member-area-index"; } echo "<a href = '" . $file . "'>" . $filename . "</a><br/>\n"; echo "</tr></td>"; } echo "</table>";
$url = "http://www.qcsasia.com/qcs-admin/action/downloadFile.php?link=" . $file; echo "<a href = '" . $file . "'>" . getNameFromFile($file) . "</a><br/>\n"; ?> </td> <td> <?php $file = rwmb_meta( 'PRODUCT_pdf_file', '' , $product->ID); $file = str_replace("www" , "dl" , $file); $url = "http://www.qcsasia.com/qcs-admin/action/downloadFile.php?link=" . $file; echo "<a href = '" . $file . "'>" . getNameFromFile($file) . "</a><br/>\n"; ?> </td> </tr> </table> <p style = "text-align:center;"> <a style = "color:blue;font-size:18px;margin-right:10px;" href = "javascript:history.go(-1)"><img src = "<?php echo esc_url( home_url( '/' ) ); ?>colors/images/left_arrow.jpg" style = 'vertical-align:middle;'/></a> <a style = "color:blue;font-size:18px;margin-right:10px;" href = "javascript:history.go(-1)">Back to document center</a>
<?php require_once "../include/member.inc.php"; require_once "../include/history.inc.php"; $link = $_REQUEST['link']; session_start(); // echo "email login = "******"idMember = " . $idMember; addHistory($idMember, "download", $link); $link = utf8_decode($link); $filename = getNameFromFile($link); header("content-type: application/octet-stream"); header('Content-Disposition: attachment; filename="' . $filename . '"'); header("Content-Length: " . filesize($link)); header("Pragma: no-cache"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public"); header("Expires: 0"); readfile($link); function getNameFromFile($file) { $tab = explode("/", $file); $name = str_replace("%20", " ", $tab[count($tab) - 1]); $name = str_replace("?m=", " ", $name); return $name; }