title: store image into a folder and its path into a database using spring rest controller
body: <p>Actually I have a criteria where I have to upload a product image into a folder and image name, image path , productname and producttype into mongoDb. I have successfully done uploading image into a particular folder from one endpoint(/uploadFile) by passing MultiPartFile as @RequestParam. I have written another enpoint to upload product details. but I am unable to get image name and image path into this endpoint(/uploadPath). Anyone there come across this situation please let me know</p>
  
  <p>i got code from  <a href="https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/" rel="nofollow noreferrer">https://www.callicoder.com/spring-boot-file-upload-download-rest-api-example/</a> to upload file now. I created a model class Image like</p>
  
  <p><a href="https://i.stack.imgur.com/iEGww.png" rel="nofollow noreferrer">Image Model Class</a></p>
  
  <p>and service class as </p>
  
  <p><a href="https://i.stack.imgur.com/ZK4LF.png" rel="nofollow noreferrer">ImageService Class</a> 
  and endpoint in rest controller like</p>
  
  <p><a href="https://i.stack.imgur.com/8LY4A.png" rel="nofollow noreferrer">FileController</a></p>
  
  <p>Actually I need Image name in folder and database to be same is it possible? how can I achieve this?
  how do I map filename in folder to filename stored in database. How do I update filename using PUT</p>