title: put multipart data with curl with different content types
body: <p>I want to ask this question because the php documentation doesn't mention it</p>
  
  <p>How would one put xml data and binary data together?</p>
  
  <pre><code>$imagecontent = @file_get_contents($imagelocation);
  $xmldata ="&lt;xml&gt;&lt;/xml&gt;";
  $headers = array("MIME-version: 1.0");
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers );
  curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
  </code></pre>
  
  <p>I know that if you pass $data as an array, curl automaticly is set to multipart, but
  how can you associate the different content types with the different contentvariables?</p>
  
  <pre><code>$xmldata
  $imagecontent
  Content-Type: application/atom+xml
  Content-Type: "jpg"
  </code></pre>
  
  <p>I have some sample wich is done with fputs and is more inline and uses boundary.
  I don't know if you also have to do that with curl and if so how to do it?</p>
  
  <p>Can anyone provide some samplecode please?</p>
  
  <p>thanks, Richard</p>