1if (function_exists('curl_file_create')) { // php 5.5+
2 $cFile = curl_file_create($file_name_with_full_path);
3} else { //
4 $cFile = '@' . realpath($file_name_with_full_path);
5}
6$post = array('extra_info' => '123456','file_contents'=> $cFile);
7$ch = curl_init();
8curl_setopt($ch, CURLOPT_URL,$target_url);
9curl_setopt($ch, CURLOPT_POST,1);
10curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
11$result=curl_exec ($ch);
12curl_close ($ch);