zx
zx3mo ago

using cloudflare r2 component is there a

using cloudflare r2 component is there a way i can compress the image or restrict filetypes?
1 Reply
erquhart
erquhart3mo ago
You should be able to follow the same steps as uploading via http action for Convex file storage, except instead of using ctx.storage.store(), you'd use r2.store() Upload with http actions: https://docs.convex.dev/file-storage/upload-files#uploading-files-via-an-http-action Store from actions with r2: https://www.convex.dev/components/cloudflare-r2#storing-files-from-actions And then within the http action (or a separate node action if your compression requires node) you can manipulate the image before storing in r2.

Did you find this page helpful?