How to view an image stored in Google cloud storage bucket?

If the object is publicly readable, you can view it directly at "https://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME", which in your case would be https://storage.googleapis.com/image-downloader-bucket/a06266f6-6082-468e-92ca-f918a48533a8.


Similar to the @ehero response but for python, the point is using content_type blob attribute before uploading the file:

from google.cloud import storage
storage_client = storage.Client.from_service_account_json('your/path/to/service/credentials.json')
bucket = storage_client.bucket('my-bucket-name')
blob = bucket.blob('my/path/in/storage.jpg')
blob.content_type = 'image/jpeg' # This one is the important
blob.upload_from_file(file) # Also available upload_from_filename

My problem was that I wasn't setting the mimetype for the object. Without it, the browser didn't know it was an image, so it was downloading the file instead of displaying it in the browser window

Adding this did the trick:

const blobStream = blob.createWriteStream({
  metadata: {
    contentType: "image/jpeg"
  }
});