[Progress Communities] [Progress OpenEdge ABL] Forum Post: How to send HTTP response with media-type = application/pdf to the browser ? REST. OE11.7

Status
Not open for further replies.
T

thierryk

Guest
Hi, I'd need to implement a REST service that generates a pdf file and send it back to the web browser. Besides, I want the browser to show the pdf file in a viewer. So it's not a direct download. I'm currently working on Developer Studio 11.7.1. My attemps were unsuccesful. The browser show the pdf viewer but the file can not be read. The pdf file generation is done. The file is valid and readable via pdf viewer. Then I tried to use the URI resource editor so that my GET service returns the pdf file with the following properties: HTTP headers: Content-Type: applicaiton/pdf Content-Length: myFileLength I also played with Content-Encoding and Content-Disposition. HTTP body: A longchar that represent the base64-encode result on the pdf file. I did the base64 conversion because OpenEdge does not support blob objects as an output of a business entity method. I'm afraid that base64 conversion is the culprit. Is there a way to achieve it properly on progress server side or do I need to embed the result in a JSON and let the client decrypts the file ? Thanks for your help. Best regards

Continue reading...
 
Status
Not open for further replies.
Top