Back

how can i display image from URL using appwrite image URL

  • 0
  • Android
  • Web
ashishkhedar
25 Jun, 2023, 03:53

I tried to display image using appwrite file url but it is not working <Image source={{ uri: 'http://localhost/v1/storage/buckets/DoctorPhoto/files/6497b4c9040711eaedb9/view?project=64717a2c981b74efdaa2&amp;mode=admin', }} style={{width: 400, height: 400}}></Image>

TL;DR
The user is trying to display an image from a URL using the Appwrite image URL. They found that replacing "localhost" with the IP address resolved the issue. The user also requests the Appwrite team to add image extensions in the image URL. Some users suggest using the Appwrite image preview and the React Native Image component. The user states that the image is not displaying using the Appwrite URL in React Native, but it works fine with other URLs. Solution: Replace "localhost" with the IP address in the image URL. Check network and console logs for any errors.
Drake
25 Jun, 2023, 03:58

What do you mean by "it's not working"?

ashishkhedar
25 Jun, 2023, 04:13

"Not working" means not working in react native Image componenteactImageView: Image source "null" doesn't exist. The image is not displaying using appwrite URL, I tried other URL from other sources. which works fine,

ashishkhedar
25 Jun, 2023, 04:16

If i past the URL in browser then it perfectly displays the image. but not displying in react native image tag

Drake
25 Jun, 2023, 04:18

What do the network and console logs from your browser say?

Drake
25 Jun, 2023, 04:18

Btw, in your app, you shouldn't have the mode=admin part

ashishkhedar
25 Jun, 2023, 04:18

ReactImageView: Image source "null" doesn't exist

Drake
25 Jun, 2023, 04:34

And what about the network logs?

Drake
25 Jun, 2023, 04:35

And what library exactly are you using to display the image?

ashishkhedar
25 Jun, 2023, 05:49

React-Native Image component

Hassanmrwt
25 Jun, 2023, 07:19

url based images are also not displayed in Flutter also. I think it is because our image url has no images extension (.jpg, .png etc) that why frame does not permit to display.

Hassanmrwt
25 Jun, 2023, 07:21

To tackle this I used appwrite image preview (storage.getFilePreview()) and used it in image widget

ashishkhedar
25 Jun, 2023, 07:36

Found the issue with url, the saved url have "localhost", replacing the "localhost" to IP work fine for me.

I have one request to appwrite team please add image extension in image URL.

Thanks @Steven and @Hassanmrwt for support.

ashishkhedar
25 Jun, 2023, 07:37

I am really impressed with appwrite community <:appwritefire:823999000330895380>

Hassanmrwt
25 Jun, 2023, 07:39

You are always welcome champ

Drake
25 Jun, 2023, 07:58

Why?

Drake
25 Jun, 2023, 07:58

It should work. Feel free to create a separate post

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more