21,887
社区成员
发帖
与我相关
我的任务
分享
$fileDir = $_REQUEST['dir'];
$th = new ThBusiness();
$path = $_REQUEST['no'];
$fileName = $_REQUEST['name'];
$file = $file_dir."img/".$fileDir.'/'.$fileName;
$one = $th->getByFname($path,$fileName);
$fileName_new = $one[0]['TFILE_NAME'].'.'.$fname;
header("Content-type:application/octet-stream");
header("Content-Disposition:attachment;filename=".mb_convert_encoding($fileName_new, 'Shift_JIS', 'AUTO'));
readfile($file);
exit;
print_r(get_headers('http://bbs.csdn.net/topics/391938815'));
Array
(
[0] => HTTP/1.1 200 OK
[1] => Date: Thu, 21 Apr 2016 07:19:32 GMT
[2] => Content-Type: text/html; charset=utf-8
[3] => Connection: close
[4] => Vary: Accept-Encoding
[5] => Vary: Accept-Encoding
[6] => ETag: "e55187e712d5cb6a82c0926a6c47929f"
[7] => Cache-Control: max-age=0, private, must-revalidate
[8] => Set-Cookie: _csdn_newbbs_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWZhOGM5ODBmZDI2ZjA0YWU4NDdjODYxMWQyNWZmMDkwBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMXpMZmgrSnl2blQwOUI5SXlFWmVPRHJYK28wVlRxbDFmWlVYcFZ0eitDc009BjsARg%3D%3D--b048385e7f5c9b1dca0d93a5ff009765bf42f185; path=/; HttpOnly
[9] => Set-Cookie: UserName=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
[10] => Set-Cookie: UserInfo=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
)
<?php
print_r(get_headers('带参数的url'));
执行一下就看到了