How to pass data (input) along with multi-file uploads?
I have my uploader configure to allow multiple image uploads; I really need to send an id along with each file to update the db onUploadComplete.
Since startUpload takes an array of files, I figured I should also send an array of ids
Here's the simplified setup:
As you can see once it gets to onUploadComplete metadata, I do have the array of Ids coming through --I'm just not sure how to get the id that corresponds to each file. I'm guessing there must be something I'm meant to do in the .input or .middleware??
Can anyone help please?
Solution:Jump to solution
This is something we actually do not handle super well right now. You can change files customId in middleware though
4 Replies
@markr (Sorry if it's bad form to tag you!!) --just wondered if you saw this, and if you have any ideas?
Solution
This is something we actually do not handle super well right now. You can change files customId in middleware though
https://docs.uploadthing.com/file-routes#middleware
The second example
Thank you! That helps so I can stop hitting my head against the wall 😅