Hi all and thanks for taking the time to answer my question.
I'm trying to send an array of bytes to the client so that his browser can reconstruct in e PDF file. Below is my code:
OutputStream out = response.getPortletOutputStream();
response.setProperty("Content-Disposition", "attachment; filename=" + fileName + ".pdf");
response.setContentType("application/pdf");
out.write(pdfInvoice);
out.flush();
out.close();
We're working with Liferay Portlets but that should not make a difference. pdfInvoice is the byte array. Nothing happens when this code executes. Can you spot what's wrong? Thanks in advance!