@@ -0,0 +1,1448 @@
+package com.tymiller.controller;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.Iterator;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RestController;%0Aimport org.springframework.web.multipart.MultipartFile;%0Aimport org.springframework.web.multipart.MultipartHttpServletRequest;%0A%0A@RestController%0A@RequestMapping(%22/rest%22)%0Apublic class PhotoResource %7B%0A%0A%09private String imageName;%0A%09%0A%09@Autowired%0A%09private PhotoService photoService;%0A%09%0A%09@RequestMapping(value=%22/photo/upload%22, method = RequestMethod.POST)%0A%09public String upload(HttpServletResponse response, HttpServletRequest request) %7B%0A%09%09MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;%0A%09%09Iterator%3CString%3E it = multipartRequest.getFileNames();%0A%09%09MultipartFile multipartFile = multipartRequest.getFile(it.next());%0A%09%09String fileName = multipartFile.getOriginalFilename();%0A%09%09imageName=fileName;%0A%09%09%0A%09%09String path = new File(%22target/classes/static/images%22).getAbsolutePath() + %22%5C%5C%22 + fileName;%0A%09%09try %7B%0A%09%09%09multipartFile.transferTo(new File(path));%0A%09%09%09System.out.println(path);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09%0A%09%09return %22Upload Success!%22;%0A%09%7D%0A%7D%0A

Add rest resource and upload method