Uploading a File under Leads as attachment from API

Uploading a File under Leads as attachment from API


Hello,

i'm trying to upload the file under Leads Module as an attachment, but i am unable to upload it here is my code

$ch=curl_init();
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_VERBOSE,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_URL,"https://crm.zoho.com/crm/private/xml/Contacts/uploadPhoto?authtoken=".TOKEN."&scope=crmapi");
curl_setopt($ch,CURLOPT_POST,true);
$post=array("id"=>$recordId,"content"=>"@path");
curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response=curl_exec($ch);
echo $err     = curl_errno( $ch );
    echo $errmsg  = curl_error( $ch );
     $header  = curl_getinfo( $ch );
echo $response;

Response 26couldn't open file "@path/test.jpg";

Its throwing above stated error, Could any one please direct me on this. Your early response is appreciated.