Back

[SOLVED] After storing on Appwrite Storage, how can I get the file url?

  • 0
  • Web
  • Databases
  • Storage
  • Cloud
  • Self Hosted
Majek
1 Jun, 2023, 13:34

Hi, I have used appwrite on my nextjs 13 app to store images. But when I call the storage.createFile I am getting a json response with just a fileId. What I want is to get the file url and then store it to appwrite database in the imgUrl field.

How can I achieve this or is there a better way to have an image preview on my app that is depending on the database records? Please also take note that imgUrl field could have different image url not only within appwrite.

Thanks.

TL;DR
The user wanted to know how to get the file URL after storing it on Appwrite Storage. Another user suggested using the `preview` endpoint if the storage is public. The original poster confirmed that they were able to view the file. The user also mentioned that they are using Appwrite on their Next.js app to store images, but when they call the `storage.createFile` function, they only get a fileId in the JSON response. They want to know how to get the file URL and store it in the `imgUrl` field of the Appwrite database. The user is also open to suggestions for having an image preview in their
Binyamin
1 Jun, 2023, 13:36

Is your storage public? If so you can use the preview endpoint Like in here https://discord.com/channels/564160730845151244/1112589191176540200/1112591019465265172

Majek
1 Jun, 2023, 13:41

oh that makes sense. Yup I am able to view now! Thanks

Drake
1 Jun, 2023, 19:37

[SOLVED] After storing on Appwrite Storage, how can I get the file url?

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