user11364823
user11364823

Reputation:

Angular: Http Post call to send pdf document to server

I am subscribing to a service HTTP get call hitting which i am downloading a pdf document.

How can i use that document, saving in any variable and trigger HTTP POST call so that i can send that document to server on any specific Action ?

Another doubt - How to get that document/document response and store it any variable ? After hitting that HTTP GET call simply file is getting downloaded. How to access that document in code ?

Server Language: Java

FrontEnd: Angular

Upvotes: 1

Views: 375

Answers (1)

Dhaval Darji
Dhaval Darji

Reputation: 513

Convert your pdf file into BSON(Binary JSON)/ base64 type, Simply store that converted data in string variable, And pass that data into body of your HTTP POST.

Upvotes: 1

Related Questions