hyperlink - make temporal link with PHP -
i won make vip download script not show main download link , make temporal link fake address downloads.
use below class , not show file size , download can't resume.
class hidden_download{ switch ($ext) { case "pdf": $ctype="application/pdf"; break; case "exe": $ctype="application/octet-stream"; break; case "zip": $ctype="application/zip"; break; case "doc": $ctype="application/msword"; break; case "xls": $ctype="application/vnd.ms-excel"; break; case "ppt": $ctype="application/vnd.ms-powerpoint"; break; case "gif": $ctype="image/gif"; break; case "png": $ctype="image/png"; break; case "jpeg": case "jpg": $ctype="image/jpg"; break; default: $ctype="application/force-download"; } header("pragma: public"); header("expires: 0"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("cache-control: private",false); header("content-type: $ctype"); header("content-disposition: attachment; filename=\"".basename($download_url)."\";" ); header("content-transfer-encoding: binary"); header("content-length: ".$fsize); ob_clean(); flush(); readfile( $download_url ); ; } }
Comments
Post a Comment