代码很简单,这里就不多废话了,本代码来至一位网友的投稿,经测试可用
}
}
}
if ($_GET['act'] == 'list') {
$filename = $_COOKIE["file_name"]; //要下载的文件名
header("Content-Type:application/force-download");
header("Content-Disposition:attachment;filename=" . $filename);
readfile($filename);
}
if ($_GET['file_name']) {
$data = file_get_contents($_COOKIE["file_name"]);
}
/ CURL 配置函数 /
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); // 跳过证书检查
//curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,true); // 从证书中检查SSL加密算法是否存在
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);
$dxycontent = curl_exec($ch);
return $dxycontent;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html ns="http://www.w3.org/1999/xhtml">