'Zip file uploaded through Lambda+API gateway with POSTMAN is corrupted

I am doing following steps:

  1. I have API gateway ( PUT Method) which integrated with AWS lambda. It is direct mapping in multipart/form-data ( so big logic is happening here )

  2. Now through POSTMAN, file is being uploaded.

  3. File is getting uploaded.

  4. When I download this ZIP file, It says "End-of-central-directory signature not found. Either this file is not a Zip file, or it constitutes one disk of a multi-part Zip file."

  5. Then I opened the ZIP in notepad++ ( yes i did that ), I can see only few line with binary data, on other hand my original file has lot of it.

Please help, let me know if some more needed.



Solution 1:[1]

I had the same issue and it turned out I was sending the request without all needed headers. It worked fine with Postman. Please check if your request contains these postman-headers

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John_IV