I have the following code generating a presigned URL in my backend:
response = s3.generate_presigned_url(
'get_object',
Params={'Bucket': 'myBucket','Key': filename},
#Headers={'Content-Disposition': 'inline; filename='+filename},
ExpiresIn=3600,
)
When I visit this URL from my browser, it automatically downloads. I would like it to open in the browser window. Ideally, my web client would be able to choose this and use the same URL. In my research, I've found that I think I can have the HTML force a download where the URL is inline, by providing a download argument to the anchor tag, like so:
<a href="that_url">view</a>
<a href="that_url" download="filename">download</a>
However, given the code I have above, the default is to download and both of these links just download. I tried including some headers but those are not acceptable arguments to generate_presigned_url.
How do I get an inline URL from this function?