Notice
Recent Posts
Recent Comments
Link
목록2022/12/07 (1)
Silver Library (Archived)
[React.js] How to let client user to download file?
핵심 요소. CORS policy, fetch, JavaScript, mutation 예시 코드. fetch('https://cors-anywhere.herokuapp.com/' + fileURL, { method: 'GET', headers: { 'Content-Type': 'application/pdf', }, }) .then((response) => response.blob()) .then((blob) => { // Create blob link to download const url = window.URL.createObjectURL( new Blob([blob]), ); const link = document.createElement('a'); link.href = url; link.setAtt..
Face the fear, build the future/Library of Logging
2022. 12. 7. 21:52