Created
February 12, 2024 09:15
-
-
Save MyFRA/557e64912844cd22ff80facdca105a37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch(agreementObj.file, {}).then(response => { | |
response.blob().then(blob => { | |
// Creating new object of PDF file | |
const fileURL = window.URL.createObjectURL( | |
blob | |
); | |
const fileName = agreementObj.file.split( | |
"/" | |
); | |
// Setting various property values | |
let alink = document.createElement("a"); | |
alink.href = fileURL; | |
alink.download = | |
fileName[fileName.length - 1]; | |
alink.click(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment