Back

Image preview is empty

  • 1
  • Android
  • Functions
  • Storage
  • Cloud
be4st
2 Aug, 2024, 17:06

I am trying to get image preview but I get an empty object.

TypeScript
export const getFile = async (fileId) => {
  return await storage.getFilePreview(
    process.env.BUCKET_ID,
    fileId
  )
}

this is how i am getting the image preview. also can u pls tell me how can i get the blob as well.

i read the documentation and also used help from AI, but no good..

thx

TL;DR
Issue: Developer is trying to get an image preview using the provided code but it returns an empty object. They are also requesting information on how to get the blob. Solution: The issue could be related to how `storage.getFilePreview()` is handling the file. Check the functionality and ensure the correct fileId and BUCKET_ID are being used. To get the blob, consider adapting the provided code to retrieve the blob directly or explore additional methods within the storage API.
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