if (eregi("(MSIE)", $HTTP_USER_AGENT)) { Header("Content-type:application/octet-stream"); Header("Content-Length:".filesize($srcPATH)); Header("Content-Disposition:attachment;filename=".$tgtPATH); Header("Content-Transfer-Encoding:binary"); Header("Pragma:no-cache"); Header("Expires:0"); } else { Header("Content-type:file/unknown"); Header("Content-Length:".filesize($srcPATH)); Header("Content-Disposition:attachment; filename=".$tgtPATH); Header("Content-Description:PHP4 Generated Data"); Header("Pragma: no-cache"); Header("Expires: 0"); } if (is_file($srcPATH)) { $fp = fopen($srcPATH, "rb"); if (!fpassthru($fp)) fclose($fp); clearstatcache(); } else { echo "해당 파일이나 경로가 존재하지 않습니다."; } ?>