This is my method in actionscript
var urlVars : URLVariables = new URLVariables();
urlVars.myname = byteArr;
var urlReq : URLRequest = new URLRequest('MyServlet');
urlReq.data = urlVars;
urlReq.method = 'post';
navigateToURL(urlReq, '_blank');
How do I recieve the byte array on servlet ?
Also the byteArr above comes from java side,
byte[] byteArr = aMethodWhichReturnsaPDFByteArray();
HttpServletResponse response = FlexContext.getHttpResponse();
ServletOutputStream os = null;
try {
response.reset();
response.setContentType("application/pdf");
response.setContentLength(byteArr.length);
response.setHeader("Content-disposition",
"inline; filename=\"Report.pdf\"");
os = response.getOutputStream();
os.write(byteArr);
os.flush();
os.close();
The above method did not work.