title: FileSystemResource to MultipartFile
body: <p>I want to send my image from my storage using the path like this: </p>
  
  <pre><code>MultiValueMap&lt;String, Object&gt; image = new LinkedMultiValueMap&lt;String, Object&gt;(); 
  image.add("image", new FileSystemResource("C:\\xx\\xx\\xx\\xx\\xx\\xx\\xx\\img\\xx.jpg"));
  </code></pre>
  
  <p>so I call the object using the code below:</p>
  
  <pre><code>MultiValueMap&lt;String, Object&gt; body = new LinkedMultiValueMap&lt;String,Object&gt;();
  body.add("image", image);
  </code></pre>
  
  <p>Then, I get this error: </p>
  
  <pre><code>Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class sun.nio.ch.ChannelInputStream]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class sun.nio.ch.ChannelInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.util.LinkedMultiValueMap["image"]-&gt;java.util.LinkedList[0]-&gt;org.springframework.core.io.FileSystemResource["inputStream"])] with root cause
  
  com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class sun.nio.ch.ChannelInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.util.LinkedMultiValueMap["image"]-&gt;java.util.LinkedList[0]-&gt;org.springframework.core.io.FileSystemResource["inputStream"])
  </code></pre>
  
  <p>I am using the Rest Template of spring boot, which requires me to send by POST Method the <code>MultipartFile</code> object. Now, I do not know how to convert into the <code>MultipartFile</code> type,<br>
   so the Rest Template can accept my request post.</p>
  
  <p>Note: I want to use the <code>body.add("image", image.getResource());</code> but It did not show up in selection since image wasn't of <code>MultipartFile</code> type.</p>