@RequestMapping(method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
@ResponseBody
public Map upload(@RequestParam(value = "file") MultipartFile file, HttpServletRequest request) throws IOException {
logger.debug("Received rest request to upload document");
Document document = new Document();
document.setContent(file.getBytes());
document.setContentType(file.getContentType());
document.setOriginalName(file.getOriginalFilename());
document.setInfo(request.getParameter("info"));
documentRepository.save(document);
Map<String, Object> result = new HashMap<String, Object>();
result.put("success", true);