# Display uploaded image (using replit object storage)

**URL:** <https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757>\
**Category:** Agent & Assistant\
**Created:** [July 1, 2025, 11:38am UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757 "2025-07-01T11:38:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin608](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/kevin608/32/1528_2.png) [@kevin608](https://replit.discourse.group/u/kevin608)\
**Post date:** [July 1, 2025, 11:38am UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/1 "2025-07-01T11:38:57Z")

</div>

I’ve uploaded an image using replit object storage. I see the image in the object storage bucket on the server.

I have (what I think) is the accurate URL of the image, but I receive the error:

> Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission ‘storage.objects.get’ denied on resource (or it may not exist).

The URL i’m using is something like this: [https://storage.googleapis.com/replit-objstore-0416681d-7baa-45ca-a0de-115f272e06d1/ec3ca965-3fb6-4e39-bc0e-3b2c4e1359ba.jpg](https://storage.googleapis.com/replit-objstore-0416681d-7baa-45ca-a0de-115f272e06d1/ec3ca965-3fb6-4e39-bc0e-3b2c4e1359ba.jpg)

I believe that replit set buckets to public on default, but possibly that needs set up somehow? I have not found anything in Replit documentation on this.

How do I access this image to show it on a page \<img src"bla.jpg"\>

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/mark/32/196_2.png) [@mark](https://replit.discourse.group/u/mark)\
**Post date:** [July 1, 2025, 2:35pm UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/2 "2025-07-01T14:35:19Z")

</div>

Welcome @kevin608!

When I worked with object storage it seemed like Agent had success putting the bucket behind an API.

Here is a live example from ConvoPath.

Chatbot avatar:

 ![image](https://canada1.discourse-cdn.com/flex010/uploads/replit/original/2X/e/e3853d9fba8e4eaeaabe1be04f43cbae38a79175.png)

Link to the actual avatar that is displayed:  
“[https://app.convopath.com/api/avatars/avatars/chatbot-cj0wxnXJDgj2W42H/avatar-1751380360632.png?t=1751380370470](https://app.convopath.com/api/avatars/avatars/chatbot-cj0wxnXJDgj2W42H/avatar-1751380360632.png?t=1751380370470)”

---

<div class="post-metadata">

**Author:** ![kevin608](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/kevin608/32/1528_2.png) [@kevin608](https://replit.discourse.group/u/kevin608)\
**Post date:** [July 1, 2025, 7:41pm UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/3 "2025-07-01T19:41:36Z")

</div>

@mark did you use streaming then to send the image? I’m unclear then on how the image is getting served.

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/mark/32/196_2.png) [@mark](https://replit.discourse.group/u/mark)\
**Post date:** [July 1, 2025, 8:01pm UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/4 "2025-07-01T20:01:35Z")

</div>

Let me check into this… bbl

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/mark/32/196_2.png) [@mark](https://replit.discourse.group/u/mark)\
**Post date:** [July 1, 2025, 8:42pm UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/5 "2025-07-01T20:42:38Z")

</div>

@kevin608 I asked Agent and got a response for you that I hope helps! Perhaps your Agent in your app might understand this? It does make sense. Essentially the app needs to display the object storage items through the app, not directly through the Google object link.

**Replit Agent’s Pro Tip for Object Storage**

> Quick Implementation Guide for Them
> 
> They need to create an API route that:
> 
> 1. Takes a file identifier as a parameter
> 2. Validates the request is for an allowed file
> 3. Uses the Replit Object Storage SDK to download the file
> 4. Serves it with proper headers (content-type, CORS, caching)
> 
> The key insight is that Replit Object Storage is meant to be accessed through your application’s API, not directly through public URLs. This is actually a more secure and flexible approach than direct file serving.

---

<div class="post-metadata">

**Author:** ![kevin608](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/kevin608/32/1528_2.png) [@kevin608](https://replit.discourse.group/u/kevin608)\
**Post date:** [July 1, 2025, 9:29pm UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/6 "2025-07-01T21:29:21Z")

</div>

Would you mind sharing your code that is used to get the image and serve it in the API? I’ve spent hours with agent, an no luck so far to get it to display.

Thanks so much for your help @mark!

---

<div class="post-metadata">

**Author:** ![mark](https://yyz2.discourse-cdn.com/flex010/user_avatar/replit.discourse.group/mark/32/196_2.png) [@mark](https://replit.discourse.group/u/mark)\
**Post date:** [July 1, 2025, 9:48pm UTC](https://replit.discourse.group/t/display-uploaded-image-using-replit-object-storage/5757/7 "2025-07-01T21:48:54Z")

</div>

@kevin608 leery of sharing the code here for security, sorry, and it would likely be different than your exact use case, but after taking another look, what I can confirm here is that my app is using the ‘Object Storage JavaScript SDK’ outlined in [the official Replit docs](https://docs.replit.com/reference/object-storage-javascript-sdk).

One thing I do recall is pasting the Replit doc URL (above) for this and other object storage related docs into Agent and asking it to implement the image to be visible in the app and publicly, since I needed the chatbot avatars to be publicly visible.

 ![image](https://canada1.discourse-cdn.com/flex010/uploads/replit/original/2X/b/b3e440d9d3b0aee5dabc09e86b0eaa78c77fa266.png)

Would love to see what you’re working on, if not comfortable posting here feel welcome to send a message.

I hope this helps get you in the right direction, I do recall it being a bit of a bear to get right.
