Files
sam-kd/account_plan/downloadExcel.php
hskwon aca1767eb9 초기 커밋: 5130 레거시 시스템
- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경
- DB 연결 하드코딩 → .env 기반으로 변경
- MySQL strict mode DATE 오류 수정
2025-12-10 20:14:31 +09:00

26 lines
707 B
PHP

<?php
// 파일 이름이 제공되었는지 확인
if (!isset($_GET['filename']) || empty($_GET['filename'])) {
die('Filename not specified.');
}
$filename = basename($_GET['filename']);
$filePath = '../excelsave/' . $filename;
// 파일이 존재하는지 확인
if (!file_exists($filePath)) {
die('File not found.');
}
// 파일을 다운로드하도록 설정
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $filename);
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($filePath));
readfile($filePath);
exit;
?>