Upload resume from Zoho Recruit API

Upload resume from Zoho Recruit API

As per API

---------------------------------
The file attachment should be base64encoded and send to us. Along with the name of the file in a separate xml node with fieldlabel_filename as below example:
<FL val="Attach resume"> TVlTUUwgMTkyLjE2OC4xNS40NCAxOTIuMTY4LjE1Ljk1IDE5Mi4xNjguMTUuNzMKRklMRSAxOTIuMTY4LjE1LjQ0IDE5Mi4xNjguMTUuOTUgMTkyLjE2OC4xNS43MwpCQUNLVVAgMTkyLjE2OC4xNS40NCAxOTIuMTY4LjE1Ljk1IDE5Mi4xNjguMTUuNzMK</FL>
<FL val="Attach resume_filename">components.txt</FL>

----------------------------------------


Can you please describe Attach resume method?

Should I send base64 encoded contents of resume (e.g waheed.doc)
Or
Should I send base64 encoded path of file?

How can I upload the resume exactly in PHP?

Here is piece of code I am using.

------------------
$xml='
<Candidates>
<row no="1">
<FL val="First name">'.$first.'</FL>
<FL val="Last name">'.$last.'</FL>
<FL val="Contact address">'.$address.'</FL>
<FL val="Email ID">'.$email.'</FL>
<FL val="Contact number">'.$contact.'</FL>
<FL val="Created On">'.$date.'</FL>
<FL val="Source">'.$source.'</FL>
<FL val="Expected salary">'.$expectsalary.'</FL>
<FL val="Current salary">'.$cursalary.'</FL>
<FL val="Total work exp (year)">'.$expyear.'</FL>
<FL val="Total work exp (month)">'.$expmonth.'</FL>
<FL val="Current job title">'.$jobtitle.'</FL>
<FL val="Current employer">'.$curemployer.'</FL>
<FL val="Additional Info">'.$info.'</FL>
<FL val="Skill set">'.$skill.'</FL>
<FL val="Resume status">New</FL>'
;

 
 if($_FILES['uploaded']['name'])
 {
    
      $target = $path.$filename ;

     if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
     {
            $contents = base64_encode(file_get_contents($target));
     }
     else {
    // echo "<font color='#FFF601' size='+1'>Sorry, there was a problem uploading your file.</font>";
     }
     
    $xml.='
<FL val="Attach resume">'.$contents.'</FL>
<FL val="Attach resume_filename">'.$filename.'</FL>';
 }


$xml.='
</row>
</Candidates>';
--------------------------------------------------

Posted through CURL call. Record added but WITHOUT attached resume.