title: RestTemplate upload image file
body: <p>I need to create RestTemplate request, which will send image to upload by PHP application.</p>
  
  <p>My code is:</p>
  
  <pre><code>Resource resource = new FileSystemResource("/Users/user/Documents/MG_0599.jpg");
  MultiValueMap&lt;String, Object&gt; parts = new LinkedMultiValueMap&lt;String, Object&gt;();
      parts.add("Content-Type", "image/jpeg");
      parts.add("file", resource);
      parts.add("id_product", productId);
  
  ResponseEntity&lt;String&gt; response = cookieRestTemplate.getForEntity(url, String.class, parts);
  </code></pre>
  
  <p>After start this app, PHP server send me information, that file is empty.</p>
  
  <p>I was thinking, that problem is by PHP site, but i've installed POSTER plugin for Firefox, and i made GET request onto this same URL, but the file to upload, i've selected normaly like in web form (popup system window to select file).
  After this PHP program uploaded file without any problem.</p>
  
  <p>I think, that problem is maybe with this, that i'm sending resource as value of param name:</p>
  
  <pre><code>parts.add("file", resource);
  </code></pre>
  
  <p>And on the POSTER plugin, i just select file from my file system ?</p>
  
  <p>Can you help me ?</p>