Hi there, I have a question currently I have connected a webflow to a backend that after its done with the request I get a URL. I can successfully view the image it returns. However, when I linked it with a button to download the image. It just opens the link. I say it is dynamic because each new backend/API request comes back with a different URL.
Currently I am using this code
function handleDownload() { } if (!upscaledImageUrl) { alert('No upscaled image to download.') return; } const link = document.createElement('a'); link.href = upscaledImageUrl; link.download = originalFilename || 'upscaled_image.png'; document.body.appendChild(link); link.click(); document.body.removeChild(link) console.log('Upscaled image downloaded.') }
`
Any suggestions?