title: Not able to access Javascript filereader in java class
body: <p>How to access my Javascript <code>FileReader</code> in my Java class.
  My HTML code is</p>
  
  <pre><code>&lt;center&gt;
                  &lt;form id="target" method="post" action="mod"&gt;
                  &lt;br&gt;
                  &lt;textarea id="textId"&gt;&lt;/textarea&gt;
                  &lt;br&gt;
                  &lt;input type="hidden" id="hiddenImages" name="hiddenImages" &gt;
              &lt;input type="submit" value="Submit"&gt;
                  &lt;/form&gt; 
          &lt;/center&gt;
  &lt;script&gt;
  var imagePath="";
  var reader=null;
  $( "form" ).submit(function( event ) { 
   imagePath=$("#textId").val();
  reader = new FileReader();
  reader.onload = function(e) {
        var arrayBuffer = reader.result;
      }
  reader.readAsArrayBuffer(imagePath); 
  imageMap.push(reader);
  $("#hiddenImages").val(reader);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm creating the file reader and setting the value to the hidden field in my form.
  In my Servlet i'm trying to access like </p>
  
  <pre><code>protected void doPost(HttpServletRequest req, HttpServletResponse resp)
          throws ServletException, IOException {
  String val=req.getParameter("textId").toString();
  FileReader files = req.getParameter("hiddenImages");
  }
  </code></pre>
  
  <p>But it's giving compilation error like <code>change the files type to String</code>. How to access the value as <code>FileReader</code> or <code>FileInputStream</code>.</p>