I have a Java servlet running on JBoss
.
Now i need to upload a document file from an swf using as3's FileReference
Class.
I get the request to the servlet and the response back in flash.
But how can i access the data/file sent from as3 with the FileReference
POST?!?!
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String userName = request.getParameter("userName");
logger.info("POST request from as3 ");
logger.info("userName " + userName); // I recive the parameter sent by URLVariables in as3 fine
String fileName = request.getParameter("Filename");
logger.info("filename " + fileName); // null
String fileData = request.getParameter("Filedata");
logger.info("fileData " + fileData); // null
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.write("success=1"); // I recive this parameter in the swf
out.close();
}
I'm testing with a 'test.txt' file, but later need to be able to upload any Text Document.
How to access the Data/File??