Justin / Leftwitch
Justin / Leftwitch•5mo ago

Trigger on convex storage

Why not? i need to validate the file the user uploaded isnt some du-du and doing that after uploading to the presigned-url would be risky since the client could just deny the "check file validity" action, the other solution would be uploading from an http action but they are also limited to 20MB sooo idk In firebase i would make a trigger on upload, check the file contents, put them through ffmpeg/ffprobe and if invalid delete again, i don't really see how to do it in convex
5 Replies
Jakov
Jakov•5mo ago
Sure, I recommend you use Firebase storage
Justin / Leftwitch
Justin / LeftwitchOP•5mo ago
Is that really the "go-to" way then? feels a bit hacky i wanted to all-in on convex tbh 😄 I'm kind of thinking of maybe using a next server action that combines upload & triggering validation but hm also seems kind of meh to me idk
Jakov
Jakov•5mo ago
Convex storage isn't really feature rich, I recommend other service
Justin / Leftwitch
Justin / LeftwitchOP•5mo ago
Alright thanks for double confirming tho!
djbalin
djbalin•5mo ago
Why not just perform this logic in the action/mutation that the user calls? I.e. before you commit the actual file to storage. We do something similar with our image upload tool - generate metadata first, check stuff, and then finally commit a storage file (and a metadata table document)

Did you find this page helpful?