Uploadthing uploading directly from express server

I am using Whatsapp Cloud API from which I am receiving different types of messages and processing it. For processing Images, Whatsapp sends the image in binary format which I am getting in my express server with responseType: "arraybuffer" format. I want to upload this image directly to uploadthing once I receive it from the Whatsapp API. How to go about this?

I have setup the following from the uplaodthing website express code

  • /api/uploadthing route in my express server
  • uploadthing.js copying the express code on uploadthing website (file is attached here)
I am confused how to actually upload the image is there some upload function in the sdk or doing an axios.post to the api available to me?

Thanks for the help !
Was this page helpful?