#Convex + R2
11 messages · Page 1 of 1 (latest)
Hi @karmic sapphire. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Uploading files to Cloudflare R2 using the Convex R2 component does consume Convex usage, but the specifics depend on how the upload is performed:
- When you use the Convex R2 component (e.g., via the
useUploadFilehook or server-side actions), Convex function calls are made to generate signed URLs, sync metadata, and potentially run custom logic (likeonUpload,onSyncMetadata, orcheckUploadcallbacks). These function calls count toward your Convex usage (function call quota) because they are executed on the Convex backend as part of the upload flow Uploading files. - The actual file transfer (uploading the file to R2 using the signed URL) does not count toward Convex bandwidth usage, as the file is sent directly from the client to Cloudflare R2. However, any server-side processing or fetching of files from R2 within Convex actions would count as action compute, not bandwidth R2/S3 billing.
In summary: uploading to R2 via Convex will consume function calls (and possibly action compute if you process files server-side), but not Convex bandwidth. The bandwidth costs for file storage and retrieval are handled by Cloudflare R2, not Convex.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@karmic sapphire Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@smoky parrot so if im uploading 10gb of files, it wont count against convex usage?
Let me check the knowledge base for you again. One moment! :books:
If you are uploading 10GB of files to Cloudflare R2 using the Convex R2 component, the file transfer itself (the 10GB of data) does not count against Convex's bandwidth usage or storage limits. The bandwidth and storage costs for those files are handled by Cloudflare R2, not Convex.
However, the Convex function calls involved in the upload process (such as generating upload URLs, syncing metadata, and any custom logic in your callbacks) will count toward your Convex function call quota. But the actual file data transfer does not count against Convex usage R2/S3 billing.
So, uploading 10GB of files to R2 will not consume 10GB of your Convex bandwidth or storage quota, but you will incur function calls for the upload process itself.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@karmic sapphire Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@smoky parrot can we get upload percentage progress from the convex r2 api?
Let me check the knowledge base for you again. One moment! :books:
I'm sorry, but the knowledge sources do not contain any information indicating that the Convex R2 API provides upload percentage progress or progress callbacks. The provided documentation and examples show how to initiate uploads, handle metadata, and process files after upload, but there is no mention of tracking or reporting upload progress from the Convex R2 API or its client hooks Uploading files.