I use C# Appwrite 0.7 package, and I’m on Appwrite 1.14, I try to get a file from a bucket using
var storage = new Storage(client); File result = await storage.GetFile( bucketId: "[BUCKET_ID]", fileId: "[FILE_ID]");
it return the file in result, but I haven’t found the method to show it in picture box, I found some old doc using file.Content, but it doesn’t work anymore. After this I tried to get a preview using
var storage = new Storage(client); byte[] result = await storage.GetFilePreview( bucketId: "[BUCKET_ID]", fileId: "[FILE_ID]");
but this time, I get result=null, and it’s the same thing for: GetFileView, or GetFileDownload. Please help, I’m struggling, I would like to use GetFile and GetFilePreview, all the files are jpg images, and under 5mo. Thanks a lot
In general, how do you handle images in your tech stack?
before appwrite, i was using sql server, putting images directly in the db, now, i tried to use var storage = new Storage(client); File result = await storage.GetFile( bucketId: "[BUCKET_ID]", fileId: "[FILE_ID]"); byte[] file = Encoding.UTF8.GetBytes(result.Content); //here the problem, no content if (result != null) using (MemoryStream stream = new MemoryStream(file)) { Image image = Image.FromStream(stream); picDocument.Image = image; }
and with this : var storage = new Storage(client); byte[] result = await storage.GetFilePreview( bucketId: "[BUCKET_ID]", fileId: "[FILE_ID]"); if (result != null) //result is always null { Image image = Image.FromStream(stream); picDocument.Image = image; }
thanks for your help
Any help please, I'm struggling, thanks
before appwrite, i was using sql server, putting images directly in the db,
And then?
please also make sure you format multiline code with backticks like you would in markdown
Recommended threads
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...
- Unauthorized Charge After Appwrite Pro F...
I was using Appwrite Pro credits worth $100, which were valid until November. During this period, I was exploring Appwrite's services. However, I recently notic...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...