하수 재이용 등록 작업 완료
This commit is contained in:
@@ -35,11 +35,7 @@ export const getFetch = async (type: string, url: string) => {
|
||||
const blob = await response.blob();
|
||||
const blobUrl = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
|
||||
// 파일명 추출 (서버에서 header에 Content-Disposition을 보낼 경우 활용)
|
||||
const disposition = response.headers.get("Content-Disposition");
|
||||
const match = disposition?.match(/filename="?(.+)"?/);
|
||||
const filename = match?.[1] || "downloaded_file";
|
||||
const filename = "downloaded_file.PDF";
|
||||
|
||||
a.href = blobUrl;
|
||||
a.download = filename;
|
||||
|
||||
Reference in New Issue
Block a user