3 Replies Latest reply on Jul 1, 2008 11:11 AM by Joey-ATL

    How do I get the returned text from a Servlet

      I made a File Upload on a Flex3 app which sends the uploaded file to a Java Servlet (using Apache FileUpload library). I am uploading a .CSV file that is parsed by Java and the servlet returns the contents in XML which works fine when I use JSP to upload to the Servlet but how to I get the returned text from the Servlet using the Flex app?

      I am using this approach for the file upload in Flex:

      fileReference = FileReference(fileList[0]);
      fileReference.addEventListener(Event.COMPLETE, uploadCompleteHandler);

      and the handler function looks like this:


      private function uploadCompleteHandler(event:Event):void{
      statusText.text = "File " + event.target.name + " uploaded successfully.";

      I'd like to get the text that is returned back from the servlet so I can use it in the Flex app. Is there another approach that I should use for file upload? Is there a better way to do a File Upload when you want to receive text back?

      Thanks in advance!