0

I am currently downloading a file via an S3 pre-signed url like so:

window.location.href = result.data.downloadUrl;

the only thing I can find to do such a thing is this post:

https://stackoverflow.com/a/56195387/904278

but I don't love the approach of clicking programatically.

Is there a better way?

bonum_cete
  • 4,730
  • 6
  • 32
  • 56
  • 2
    drive by downloads are discouraged. – Daniel A. White Oct 19 '21 at 17:20
  • This is for an internal tool. When you click a download button, the pre-signed url is generated and `window.location.href = result.data.downloadUrl;` is ran. So it's not really a surprise to the user they're getting a download. However, this has made me think of a better way to achieve what I'm trying to do. – bonum_cete Oct 19 '21 at 17:52

0 Answers0