ghow to upload image by using res template
public String saveCompanylogo(File file){
String url = COMPANY_URL+ "/saveCompanyLogo";
MultipartEntity multiPartEntity = new MultipartEntity ();
FileBody fileBody = new FileBody(file) ;
//Prepare payload
multiPartEntity.addPart("file", fileBody) ;
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
HttpEntity<MultipartEntity> entity = new HttpEntity<MultipartEntity> (multiPartEntity, headers);
ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, entity, new ParameterizedTypeReference<String>() {
});
return exchange.getBody();
}