$target_url = 'http://127.0.0.1/accept.php';//This needs to be the full path to the file you want to send.$file_name_with_full_path = realpath('./sample.jpeg');$post = array('extra_info' => '123456','file_contents'=>'@'.$file_name_with_full_path); $ch = curl_init();curl_setopt($ch, CURLOPT_URL,$target_url);curl_setopt($ch, CURLOPT_POST,1);curl_setopt($ch, CURLOPT_POSTFIELDS, $post);curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);$result=curl_exec ($ch);curl_close ($ch);echo $result;
';if (move_uploaded_file($_FILES['file_contents']['tmp_name'], $uploadfile)) {echo "File is valid, and was successfully uploaded.n";} else {echo "Possible file upload attack!n";}echo 'Here is some more debugging info:';print_r($_FILES);echo "nn";print_r($_POST);print ". "e>n";