파일 다운로드 소스


//$file_name : 실제 다운받을 파일이름.

$filepath="../data/".$file_name;
if(eregi("(MSIE 5.0|MSIE 5.1|MSIE 5.5|MSIE 6.0)", $HTTP_USER_AGENT)){
Header("Content-type: application/octet-stream");
Header("Content-Length: ".filesize($filepath));
Header("Content-Disposition: attachment; filename=$file_name");
Header("Content-Transfer-Encoding: binary");
Header("Pragma: no-cache");
Header("Expires: 0");
} else {
Header("Content-type: file/unknown");
Header("Content-Length: ".filesize($filepath));
Header("Content-Disposition: attachment; filename=$file_name");
Header("Content-Description: PHP3 Generated Data");
Header("Pragma: no-cache");
Header("Expires: 0");
}
$fp = fopen($filepath, "r");
if (!fpassthru($fp)) fclose($fp);
?>
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2003/11/10 09:43 2003/11/10 09:43
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/19

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/19

« Previous : 1 : ... 6320 : 6321 : 6322 : 6323 : 6324 : 6325 : 6326 : 6327 : 6328 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/11   »
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Statistics Graph

Site Stats

Total hits:
237090
Today:
207
Yesterday:
1352