download.php?file=board_80_0.xls&url=../files/board/1/board_80_0.xls $file= $_GET['file']; // 화일이 실제로 있는 위치를..
$filename=$_GET['url'];
//$file_size=filesize($file);
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matterrn");
header("Content-Disposition: filename=".$file."");
header("Content-Transfer-Encoding: binaryrn");
header("Pragma: no-cache");
header("Expires: 0");
}else if(strstr($HTTP_USER_AGENT, "MSIE 6.0"))
{
Header("Content-type: application/x-msdownload");
Header("Content-Length: ".(string)(filesize("$filename"))); // 이부부을 넣어 주어야지 다운로드 진행 상태가 표시
Header("Content-Disposition: attachment; filename=$file");
Header("Content-Transfer-Encoding: binary");
Header("Pragma: no-cache");
Header("Expires: 0");
}else{
Header("Content-type: file/unknown");
Header("Content-Length: ".(string)(filesize("$filename")));
Header("Content-Disposition: attachment; filename=".$file."");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if(is_file("$filename")){
$fp = fopen("$filename","rb");
if (!fpassthru($fp))
fclose($fp);
}
?>
<--링크 -->
download.php?file=board_80_0.xls&url=../files/board/1/board_80_0.xls
$filename=$_GET['url'];
//$file_size=filesize($file);
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matterrn");
header("Content-Disposition: filename=".$file."");
header("Content-Transfer-Encoding: binaryrn");
header("Pragma: no-cache");
header("Expires: 0");
}else if(strstr($HTTP_USER_AGENT, "MSIE 6.0"))
{
Header("Content-type: application/x-msdownload");
Header("Content-Length: ".(string)(filesize("$filename"))); // 이부부을 넣어 주어야지 다운로드 진행 상태가 표시
Header("Content-Disposition: attachment; filename=$file");
Header("Content-Transfer-Encoding: binary");
Header("Pragma: no-cache");
Header("Expires: 0");
}else{
Header("Content-type: file/unknown");
Header("Content-Length: ".(string)(filesize("$filename")));
Header("Content-Disposition: attachment; filename=".$file."");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
if(is_file("$filename")){
$fp = fopen("$filename","rb");
if (!fpassthru($fp))
fclose($fp);
}
?>
<--링크 -->
download.php?file=board_80_0.xls&url=../files/board/1/board_80_0.xls