본문 바로가기

프로그램 경험/PHP

[PHP] 파일 다운로드


<?php


$justfilename = 'abc.pdf';       

$filefullpath = '/home/you/file/path/'. justfilename;

header('Content-type: application/x-unknown');

header("Content-Disposition: attachment; filename=\"".$justfilename."\";");

readfile($filefullpath);

'프로그램 경험 > PHP' 카테고리의 다른 글

[PHP] UTF-8 을 EUC-KR로 변환 하기  (0) 2012.04.12
[PHP] 파일 UTF-8로 저장하기  (0) 2012.04.12
[PHP] 파일 사이즈 단위 출력하기  (0) 2012.03.27
[PHP] JSON 사용  (0) 2012.03.23
[PHP] 난수 생성  (0) 2012.03.22