与PHP建立时间链接

时间:2014-06-02 12:31:16

标签: php hyperlink download

我赢得了不显示主下载链接的VIP下载脚本,并使用虚假地址进行下载时间链接 我使用下面的课程,但有了这个,不显示文件大小和下载不能恢复。

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 ); ;
}  }

0 个答案:

没有答案