Back

[SOLVED] set the file type in bucket

  • 1
  • Self Hosted
  • Web
  • Storage
  • Cloud
otik
1 Aug, 2023, 17:16

Hi i have a long time problem. I create the files (images) into bucket, img is sent from client -> server, where is saved. But problem is that i cant set the type of file i am saving. It always saves it like plain/text (so it is Base64 in text).

I send 2imgs - code - result in cloud

TL;DR
The user was able to solve their issue by using the node-base64-image package. They asked for help on how to set the file type in the bucket. They were advised to store the actual image bytes instead of the base64 encoded text. It was mentioned that if they base64 decode it, they would have the actual image bytes. The user confirmed that they were passing in base64 encoded text. Overall, the user successfully resolved their problem.
Drake
1 Aug, 2023, 17:30

are you passing in base64 encoded text?

otik
1 Aug, 2023, 20:08

yes i am

Drake
1 Aug, 2023, 20:24

well then it's plain/text...if you want it to be picked up as an image, it needs to be in image

So i assume if you base64 decode it, you'll have the actual image bytes? store that instead

otik
2 Aug, 2023, 11:32

could you please help me how to do it?

otik
2 Aug, 2023, 12:29

I solved it, thank you for everything. (i used node-base64-image)

Drake
2 Aug, 2023, 16:04

[SOLVED] set the file type in bucket

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