How can I translate this curl command so that it works in a PHP script?
curl --request POST --data-binary \'@import.xml\' --header \"Content-Type: applicatio
$data = array('file'=> '@' . $filename);
You need to prepend the filename with a '@' to tell CURL it's actually a filename and not just a string. The headers are not required either, as CURL will fill them in itself.