After submitting the form with file it gives me SyntaxError <pre> </pre>in firefox , cause of this error was content type, it was application/json, to fix problem yous should change it to application/xml ( in java response.setContentType("application/xml"))