파일 다운로드가 안되는데요 잘아시는분 계실까요?? 채택완료
GST1
3년 전
조회 975
</p>
<p> </p>
<p><?php
if($file_name) {
$file_path = "./data/".$id."/".$file_copied;
$file_size = filesize($file_path);</p>
<p> echo "▷ 첨부파일 : $file_name ($file_size Byte)
<a href='download.php?num=$num&id=$id&file_copied=$file_copied&file_name=$file_name&file_type=$file_type'>[저장]</a>
";
}
echo $content; // 글 내용 출력
?></p>
<p>
다운로드파일
$id = $_GET["id"]; $file_copied = $_GET["file_copied"]; $file_name = $_GET["file_name"]; $file_type = $_GET["file_type"]; $file_path = "./data/".$id."/".$file_copied;
if(file_exists($file_path)) { header("Content-Type: application/octet-stream"); header('Content-Description: File Transfer'); header("Content-Disposition: attachment; filename=$file_name"); header("Content-Transfer-Encoding:binary"); header("Cache-Control:cache,must-revalidate"); header("Pragma: public"); header("Content-Length: " . filesize($file_path)); flush(); readfile($file_path); die(); }
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인