How to add metadata to file been uploaded?

im running app where users can upload files inside each orders, but i want to store the url in my own db, so i have to send order id when uploading so i can get it in my uploadthings route and upload it, i can do this on the after update property of the upload button but would like to know if there is a better way of handling this?
1 Reply
Ayoub K
Ayoub K4mo ago
There's another way, you can add an input to your server logic and validate it using zod https://docs.uploadthing.com/api-reference/server#input
Server – uploadthing
Docs for the best file uploader to date
Want results from more Discord servers?
Add your server