답변 2개
채택된 답변
+20 포인트
선택과집중
Expert
7개월 전
아래 테스트해보세요. 참고로 iOS Safari에서 정상 다운로드 확인.
<?php
$file = '/경로/파일명';
$filename = basename($file); // 또는 pathinfo() 사용. 기타 등등 다양한 방법으로 파일명만 할당
if ( 모바일 디바이스 ) {
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="'.$filename.'"');
} else {
// 일반적인 엑셀 헤더
}
readfile($file);
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인