Sendind a image by multipart/form-data with required json body

Hello support, im trying to send a image by a simple POST http-request with multipart/form-data.

First i saved the image file into a directory that n8n can read (locally), what im doing wrong ?

Do you have some example for me ?

In my raw-body my api need a json to specify the file in this required format:

{

“multipartFile”: “/data/test.jpg”

}

But my API server returns im sendind a NULL…

To better understand, using CURL works like this:

curl --location --request POST ‘https://lab-api.com/Pic/uploadPic?mechId=2020&barCode=20222&NumPic=1’ \
–header ‘Authorization: mytoken’
–form ‘multipartFile=@“test.jpg”’

Hey @MGD,

Have you tried sending the binary data? Sending the filepath won’t work but something like the below might do the job.

1 Like