How Do i get a image to display on my website using the avatar/storage SDK on web
- 0
- Avatars
- Web
- Storage

Hi, say I want to fetch this and display it on my html page. How would I do that? I usually use a img tag but not sure how it's done using the SDK. Any example would he appreciated 🙂

what did you see when you logged the response?

Url array which includes a href address. Do i just take that and throw it into a img tag?

array? it should just be a url string 🧐 which you should be able to put into an img tag


ahhh this is a javascript URL object

Its giving all of this, I'm not sure if I'm using the function it right just take the href

Or as I supposed to use the whole thing to view the optimised image

I see thanks I'll keep this terminology in mind

so you can do response.toString()
to get the URL string. see https://developer.mozilla.org/en-US/docs/Web/API/URL/toString

Okay I know what it's doing now, I cna use the href it provides (not the same ws the one i supplied) as it can optionally add the width and height and it will scale it down to optimise for transfer 😁

I'll try this too thanks

ya, either works

Thanks, thought it was making things more complicated for no reason but I understand what it's doing now 😅 it's very useful! Cheers
Recommended threads
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
