Closed Daemach closed 1 year ago
This looks useful, thank you! Could you clean this up to remove the extra changes that do not pertain to this pull request? Also, I would prefer that the new argument be called queryParams
rather than headers
, since it will put whatever you add into the query string whether it prompts a header override or not.
As a side note you have the following comment:
headers = { "response-content-type": "application/octet-stream" } is useful for forcing a download
In my experience the header that suggests to the browser that it download vs open inline is the Content-Disposition header. From the examples there:
Content-Disposition: attachment; filename="cool.html"
tells the browser to download the file, and suggests a filename for the file. So you would use:
queryParams = { "response-content-disposition": "attachment" } is useful for forcing a download
@jcberquist Done! Thanks for the advice.
Thanks! I cleaned things up a bit before merging.
I needed to force the browser to download a presigned URL rather than open it. Adding headers solved the problem.