Cant upload File (of that particular format) using POST API

0
In my project, I implemented POST and GET APIs to handle PDF file uploads and downloads. The requirement was to upload a file in PDF format using a POST API and later retrieve it using a GET API. While the file uploads successfully through the POST API, it is not stored in the correct PDF format, and when downloaded, the content becomes unreadable.
asked
1 answers
0

Hi Arif,

While you upload the file using REST API (in your POST call), send the file by encoding it into BASE64 version and after upload decode the file with BASE64 again before you store the file.

Similarly in your GET call, use the Same Base64 to encode/decode to get the file back.

 

Regards

Ajay

answered