Alexander
Alexander

Reputation: 20224

Lotus Script Web Agent: Send binary data back to browser

I have a Lotus Script Agent that shall return a decoded PDF file (as attachment) that is stored in Notes as a base64 encoded string:

Print("Content-type: application/pdf")
Print(DecodeBase64(PDFContentBase64))

The issue is that the PDF contains null bytes and the Print statement seems to terminate at the first null byte it encounters. Is there a way to send binary data back to the user's browser from a Lotus Notes Agent?

Upvotes: 1

Views: 1029

Answers (1)

Éric Viala
Éric Viala

Reputation: 616

Having an agent print something that should be interpreted by the browser may not be the best course for your intent.

You could attach the PDF to a document then present that document to the user.

Another way, which may or may not be suitable depending on confidentiality concerns and on how cooperative your admin is, would be to save the pdf in the data/domino/html directory on the server then pass the corresponding URL to the browser.

Upvotes: 1

Related Questions