0

below is example of postback message. I am posting data to a party using spring rest. In return they will send me raw pdf data along with postback message. How do I read this pdf data and download the pdf file in browser on request at later time.

Appreciate your help with the code.

of I am reference text

------------d0f32ac86c8249c9aa562c1fcfbfeb66
Content-Disposition: form-data; name="filename"

Bk-40274-tx17-Mess.pdf
------------d0f32ac86c8249c9aa562c1fcfbfeb66
Content-Disposition: form-data; name="fileformat"

pdf
------------d0f32ac86c8249c9aa562c1fcfbfeb66
Content-Disposition: form-data; name="file"; filename="Bk-40274-tx17-Mess.pdf"
Content-Type: application/pdf
Rajesh Pandya
  • 1,540
  • 4
  • 18
  • 31

1 Answers1

0
  1. You need to create UploadRestController that will receive pdf content.You can follow below link to develop your UploadRestController.

Spring : File Upload RESTFUL Web Service

  1. Your UploadRestController will save file somewhere in file system and its file path/other stuff matadata in DB or Cache.

  2. Develop another DownloadRestController that will give you PDF whenever requested.It will read file from file system using metadata and will set response.You can follow below link to develop DownloadRestController.

Return generated pdf using spring MVC

Oomph Fortuity
  • 5,710
  • 10
  • 44
  • 89