1

I'm attempting to send a file to an API I've been developing through Postman, but the API has repeatedly failed to receive it. I initially thought this was a middleware issue, and attempted to use different modules to fix it. However, I have since realized that this is actually an issue in Postman itself

When I send the request and then review the request body in the Postman console, I can see that it fails to send the file at all, listing it as undefined.

Screenshot showing the request body as sent

I have seen a few people having this same issue, but was not able to find a solution that worked for me. I have already tried unchecking the Content-Type header, as well as closing and reopening the tab and Postman.

EDIT: I did not receive an answer to this, but I was able to find a workaround - coding a super basic html form that made a post request to the relevant endpoint. This did work, so I'm going to say this is likely a bug or settings issue in Postman itself, rather than something to do with my server's code.

Chris
  • 29
  • 3
  • This https://makolyte.com/how-to-upload-a-file-with-postman/ worked for me Good luck – Ken Feb 08 '22 at 15:01

1 Answers1

0

Pretty sure you were in this thread already, but just in case, this answer, and this one might be what you need.

overgoer
  • 23
  • 4
  • I've attempted the solutions depicted here (sending two items, one "file" item containing the file and one "json" item containing the param keys with its content type set to application/json) - they do not work. I am still seeing the file listed as undefined in the request body - see here, https://imgur.com/a/ZsvEft8 – Chris May 27 '21 at 19:38