below is my code:
$urlToWa = 'XXX:XX:XXX:XX:XXXX/recruit/sendEmailWithFile?to='.$mail.'&name='.$name;
$ch = curl_init($urlToWa);
print_r($_FILES['file']);
$cfile = new CURLFile($_FILES['file']['type'], $_FILES['file']['name']);
// $_SESSION['plikObr'] = $cfile;
$data = array("file" => $cfile);
curl_setopt($ch, CURLOPT_URL, $urlToWa);
curl_setopt($ch, CURLOPT_USERPWD, 'request:nowChuckyNextSamara');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$response = curl_exec($ch);
And i have some problem with creating CURLFile. In the second server i have the same script and everything work well. On the server where is above script i have curl library in 7.22 version, and on the second server where everythings work i have curl in 7.47 version.
Where is the problem? Thanks for herp