0
**# setting response for uploading file to s3.**

client = boto3.client('s3', aws_access_key_id=AWS_ACCESS_KEY_ID,
                                  aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
response = client.put_object(
                Bucket=BUCKET_NAME, Body=in_mem_file.getvalue(), Key=str(img_name))
            
**# getting s3 url of the uploaded image.**

url = client.generate_presigned_url('get_object',  Params={
       'Bucket': BUCKET_NAME, 'Key':str(img_name)}, ExpiresIn=518400)

I am generating a URL for the uploaded image, but the the url generated is getting downloaded. How to make it streamable instead of downloading.

PS - The S3 bucket is a private one.

surya raj
  • 195
  • 13
  • 1
    What is the difference between downloading and streaming in your opinion? Especially for images, what does streaming an image mean? What do you expect to happen and why?? How is the client handling the url? – luk2302 Aug 08 '22 at 08:04
  • what I meant is opening in the browser itself without downloading. – surya raj Aug 08 '22 at 08:10
  • Once again that is the same thing from the server perspective. So your question is actually how to display the file in the browser instead of the browser actively downloading the file into the Downloads folder!? (in both cases the image is downloaded) – luk2302 Aug 08 '22 at 08:12

0 Answers0