I am wanting to send a file via http POST using PHP and cURL.
The form POST was working ok with basic fields besides the file being posted with \'application/json\'.
One omission I see is that you need to add your $cfile object to the $data array. This, coupled with the answer by Samir, should get you all squared away.
$cfile
$data