3👍
✅
One of the simple ways to do this is using fetch
.
let url = '...'
fetch(url)
.then(response => response.blob())
.then(blob => {
...
})
After you have blob you can convert it to file. See How to convert Blob to File in JavaScript.
Source:stackexchange.com