파일다운로드시 다운로드창 띄우기
페이지 정보
작성자 JMStudy 작성일06-03-22 11:33 조회8,978회 댓글0건본문
다운로드
#############
#download.php
#############
<?
if ($ext == 1) { $ftype = "file/unknown"; }
else { $ftype = "application/octet-stream"; }
Header("Content-Disposition: attachment; filename=$name");
Header("Content-Type: $ftype");
Header("Content-Length: ".filesize("$path"));
Header("Pragma: no-cache");
Header("Expires: 0");
if ($fp = fopen("$path", "r")) {
print fread($fp, filesize("$path"));
}
fclose($fp);
exit();
?>
#############
#download.php
#############
<?
if ($ext == 1) { $ftype = "file/unknown"; }
else { $ftype = "application/octet-stream"; }
Header("Content-Disposition: attachment; filename=$name");
Header("Content-Type: $ftype");
Header("Content-Length: ".filesize("$path"));
Header("Pragma: no-cache");
Header("Expires: 0");
if ($fp = fopen("$path", "r")) {
print fread($fp, filesize("$path"));
}
fclose($fp);
exit();
?>
댓글목록
등록된 댓글이 없습니다.