title: how to put image in json as data
body: <p>i am working on a code for rest api in which  i am at page "imageTest" wth a image and button "onclick event" of the button will call function "foo()"</p>
  
  <pre><code>          @RequestMapping(value = "/imageUpload2/", method = RequestMethod.POST, produces = "application/json")
  public ResponseEntity profilePicTest(@RequestBody String data) {
      System.out.println("imageString length : " + data.length());
      System.out.println("imageUpload : " + data);
  
          return new ResponseEntity(null, HttpStatus.OK);
  </code></pre>
  
  <hr>
  
  <p>javascript part</p>
  
  <pre><code>    function foo() {
      alert('uploading image to imageupload2 url');           
      var profpic = document.getElementById("profpic");
      alert('uploading image1122334455')
      jQuery.ajax( {
          url: 'http://localhost:8090/EventApp/imageUpload2/',
          type: 'POST',
          data: { img: profpic },
          success: function( response ) {
              // response
              }
      } ); alert('uploading done')
      }
  </code></pre>
  
  <p>can anyone help me in the part were i can upload image by javascript (with encoding like base64) which restcontroller can accept that image string further convert into byte[] array and inserted into oracle db blob column and vice versa to send it back </p>
  
  <p>------problem part---- 
  image not uploading in json as string
  please anyone help me ...!</p>