다운로드 파일명 유지
This commit is contained in:
@@ -756,6 +756,15 @@ void setup() {
|
||||
if (SD.exists(filename)) {
|
||||
File file = SD.open(filename, FILE_READ);
|
||||
if (file) {
|
||||
// 파일명만 추출 (경로 제거)
|
||||
String displayName = server.arg("file");
|
||||
|
||||
// Content-Disposition 헤더 추가 (원본 파일명 지정)
|
||||
server.sendHeader("Content-Disposition",
|
||||
"attachment; filename=\"" + displayName + "\"");
|
||||
server.sendHeader("Content-Type", "application/octet-stream");
|
||||
|
||||
// 파일 전송
|
||||
server.streamFile(file, "application/octet-stream");
|
||||
file.close();
|
||||
} else {
|
||||
@@ -768,7 +777,6 @@ void setup() {
|
||||
server.send(400, "text/plain", "Bad request");
|
||||
}
|
||||
});
|
||||
|
||||
server.begin();
|
||||
|
||||
canQueue = xQueueCreate(CAN_QUEUE_SIZE, sizeof(CANMessage));
|
||||
|
||||
Reference in New Issue
Block a user