Is this is legit way to upload files? Haven't seen this in any example
With this approach you do not have to create http route.
frontend:
3 Replies
backend image.ts
backend image_node.ts
Is this suppose to be slower? faster? better? worse?
Yes this is fine! There are some limits: argument size is limited to 8MB. Speed should be similar, the image isn't compressed client-side in either approach.
Also base64 isn't the most efficient way to store data, it's got ~33% overhead. Convex functions also support array buffers of binary data, you could do that instead.
It's not obvious which would be faster, but if you were sending the image somewhere else instead of sotring it in convex storage then HTTP might be faster because you can do it streaming
Thank you for the insights!