external_path.'/tmp/temp'. $index .date('Y-m-d_h-i-s') .'.png'; $curlFile = curl_file_create($file); $success = file_put_contents($file, $data); $headers = array('Content-Type: multipart/form-data'); // $headers = array('Content-Type: application/json'); $ch = curl_init(); $log_msg = " PullcreditPdPhotographsData api (".$fields['img_name'].")"; $fields['img'] = $curlFile; curl_setopt( $ch,CURLOPT_URL, CET_CREDIT_PD_INTEGRATION_IMG_URL); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); // curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, true ); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); $result=curl_exec($ch); $response = json_decode($result); log_message('ERROR',"###CET APP CREDIT PDID (".$pdid.") ".$log_msg."response :".json_encode($response)); curl_close( $ch ); unlink($file); // unlink($file_name_with_full_path); } } ?>