?
Path : /home/admin/public_html/old/promice/components/com_download/ |
Current File : /home/admin/public_html/old/promice/components/com_download/downloadfile.php |
<?php //dir $upload_dir = '../../administrator/components/com_download/assets/template/'; //if isset filename $filename = isset($_GET['file'])?$_GET['file']:''; //check filename is true if ( !preg_match('/^[a-z0-9\_\-][a-z0-9\_\-\. ]*$/i', $filename) || !is_file($upload_dir.$filename) || !is_readable($upload_dir.$filename) ) { echo "Loi: Ten file khong hop le hoac file khong ton tai!"; exit(-1); } $fp = fopen($upload_dir.$filename, "rb"); header('Content-type: application/octet-stream'); header('Content-disposition: attachment; filename="'.$filename.'"'); header('Content-length: ' . filesize($upload_dir.$filename)); fpassthru($fp); fclose($fp); ?> <h3>Thanks for Download</h3>