
After the user uploads a file to the bucket I want to reduce its size using a function with the help of the sharp node js library.
I was wondering if when I am saving the file sharp().toFile()
method and then re-upload it to the bucket is the file going to live in the open runtime container? If the worker clears the container is the file going to live on the disk?

Hi

It is gonna be in separate runtimes

And regarding re-uploading, it's important to mention you cannot updateFile. You would need to create new file in Appwrite Storage, and remove old one by it's ID. Then use new ID where-ever you need

so after the function is completed the disk file will be removed by the runtime?

worst-case scenario, it will be removed after 15 minutes of inactivity (when runtime stops). Its still recommended to delete the file anyway, yes. To preserve disk space.

Thanks. Is there any better way to implement image compression for appwrite?

Check out the Storage and Process Photo sections here: https://levelup.gitconnected.com/building-a-location-based-app-with-appwrite-48a2e2b6d4c2#8e5c

@Monzim everything good on your end so we can close this? 🙂

[SOLVED] Appwrite function to reduce file Size
Recommended threads
- Stuck in Readonly Mode After Pro Subscri...
Hello team, I really need some urgent help. I recently resubscribed to the Pro plan hoping to get back into a project I created a while ago, but I'm still unab...
- Missing C++ libstdc library in Python fu...
I have a function running Python 3.12 which suddenly started dumping errors (as of today; it worked yesterday). I hadn't changed any code so I found this odd, b...
- Checkout error: Error: Request body is e...
Im absolutely stumped here. ```Initializing Stripe functionality... stripe.ts:74 Calling Appwrite function with payload: {price_id: 'price_1RdZzoDCvcSnLsdCCu8z3...
