FormData in HttpAction
Hey guys, I'm trying to use formdata from the httpAction but unfortunately unable to. Seeing this error:
I suspect that calling this in a nodejs env wouldn't fix this π€ . Some context: I'm trying to upload a file from F/E to convex using an http action with some extra metadata. I can probably stuff that metadata into a header for now but would rather not π
Any thoughts around this?
8 Replies
Hi! I ran into this same error in my own app. Sorry about that. Let me see what I can do today to fix it.
Yep you're totally right that this error message is misleading and switching to a node action won't help. As Lee said, we'll look into adding some support here.
I was going to suggest using a JSON body, but then re-read that you're using this for uploading a file, so that wouldn't work.
@tstepro for your use-case, are you using a url-encoded form or a multi-part form? we can support both, but url-encoded forms are easier so we can ship that faster if it would help you.
I am using a multi-part form for this use case.
Okay cool. Gotta go implement that now π
Thank you @lee π
Hey @lee, when thatβs done what will I need to do on my end to upgrade to that implementation?
@tstepro you can start using
request.formData()
now -- the implementation just finished deploying (no upgrade necessary, it should just work). i tested it in several ways, but you're the first customer to use it, so let me know how it goes!Youβre awesome Lee. Thank you π
Confirming with you that this works π
Thanks again for shipping this so fast π