I have a canvas which I'm converting to a blob using
canvas.toBlob()
I have then made an endpoint on my node js server that expects an image in the form data using express-fileupload
So here I am trying to attach the blob to the body of my axios call like this
return await Axios({
method: 'post',
url: `${api}/contract/sign`,
timeout: 30000,
data: {
name: name,
signature: blob
}
})
It's sending it as an empty object,
I have tried
new File([ blob ], 'signature.png' )
But that doesn't work either. I have also tried changing the content type in the header but I have other params to send so I cannot do that
Here is my postman code which works for me but I cant replicate it in code
curl --location --request POST 'endpoint' \ --header 'Authorization: Bearer token' \ --form 'signature=@/myImage.png' \ --form 'name=myName'