put multipart data with curl with different content types

inappropriatus

New Member
I want to ask this question because the php documentation doesn't mention itHow would one put xml data and binary data together?\[code\]$imagecontent = @file_get_contents($imagelocation);$xmldata ="http://stackoverflow.com/questions/2119925/<xml></xml>";$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\]I know that if you pass $data as an array, curl automaticly is set to multipart, buthow can you associate the different content types with the different contentvariables?\[code\]$xmldata$imagecontentContent-Type: application/atom+xmlContent-Type: "jpg"\[/code\]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?Can anyone provide some samplecode please?thanks, Richard
 
Back
Top