title: Upload Binary file on aws s3 using java Spring
body: <p>I am able to upload file Using Form data as given below</p>
  
  <p><a href="https://i.stack.imgur.com/7SAaa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7SAaa.png" alt="enter image description here"></a></p>
  
  <p>but when i am trying to upload file by selecting binary as input getting error as given below;</p>
  
  <pre><code>{"timestamp":1490680735011,"status":500,"error":"Internal Server Error","exception":"org.springframework.web.multipart.MultipartException","message":"Current request is not a multipart request","path":"/uploadBinary"}
  </code></pre>
  
  <p>for that i am writing code as</p>
  
  <pre><code>@RequestMapping(value = "/uploadBinary", method = RequestMethod.POST)
  public ResponseEntity&lt;Object&gt; uploadBinary(
          @RequestParam("file") MultipartFile[] multipartFiles) {
      try {
          System.out.println("starting....");
          fileService.upload(multipartFiles);
          System.out.println("uploaded successfully ");
      } catch (Exception ex) {
          System.out.println(ex.getMessage());
          return new ResponseEntity&lt;Object&gt;(new String(
                  "Something Went wrong while uploading data to server"),
                  HttpStatus.OK);
      }
      return new ResponseEntity&lt;Object&gt;(new String("uploaded successfully "),
              HttpStatus.OK);
  }
  </code></pre>
  
  <p>this works fine for uploading form data, but for binary selection its not working. how we resolve this issues?? </p>