javascript
-
[자바스크립트] presignedUrl 다운로드개발 흉내 2021. 3. 30. 18:52
how to download s3 presignedUrl in javascript 최신 브라우저는 다음 코드로 충분하다. // download in modern browser function download (url) { const link = document.createElement('a'); link.href = url; link.click(); } a 태그를 생성하고 url를 잡아준 뒤 클릭한 것같은 효과를 낸다. 클릭에서 다운로드가 시작될 것이다. 근데 IE에서는 아무런 반응이 없다. DOM에서 로딩되지않으면 실체가 없다고 판단하는 모양이다. DOM에 추가한 뒤 바로 토끼자. // download in IE function download (url) { const link = document.cr..