php – I need to upload a photo by cURL, I would like to send it in binary, so I do not need to use base64 conversion

<? php
session_start ();
include & # 39; VerificationLogin.php & # 39 ;;
include & # 39; connection.php & # 39 ;;

$ cpf = & # 39; 17958109717 & # 39 ;;
$ proposed = & # 39; 123456 & # 39;
$ temporary_name = $ _FILES["Arquivo"]["tmp_name"];
$ real_name = $ _ FILES["Arquivo"]["name"];
$ image = $ _FILES["Arquivo"];
$ ext = $ _FILES["Arquivo"]["type"];
$ type = explode ("/", $ ext);

// if the image has been selected
if (! empty ($ image["name"])) {

// Maximum width in pixels
$ width = 1024;
// maximum height in pixels
$ height = 1024;
// Maximum file size in bytes
$ size = 900000;

// Check if the file is an image
if (! eregi ("^ image  / (pjpeg | jpeg | png) $", $ image["type"])) {
fault[1] = "This is not an image.";
echo "";
}

// Get the dimensions of the image
$ dimensions = getimagesize ($ image["tmp_name"])

// Check if the width of the image is greater than the width allowed
if ($ dimensions[0] > width} {
echo "";
}

// Check if the height of the image is greater than the height allowed
if ($ dimensions[1] > $ height) {
echo "";
}

// Check if the size of the image is larger than the allowed size
if ($ image["size"] > size) {
echo "";
}

// there is no error
if (count ($ error) == 0) {
copy ($ temporary_name, "images / S. $ cpf. $ proposed. $ type[1]");
}
}
// path to the image
$ image_path = "http://200.142.118.109:5000/WCF/OneUpload/WCFUploadDownload.svc/Upload?Propose=$Proposed&CPF=$cpf&TipoArquivo=Selfie&NomeArquivo=NotArquivo=$number_temporario.$";

postRequest function ($ myCookieFile) {
$ curl = curl_init ();
curl_setopt_array ($ curl, array (
CURLOPT_PORT => "5000",
CURLOPT_URL => "$ image_path",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array (
"Cache-Control: no-cache",
"Content-Type: application / x-www-form-urlencoded",
)
CURLOPT_COOKIEJAR => $ myCookieFile,
CURLOPT_COOKIEFILE => $ myCookieFile
));

$ err = curl_error ($ curl);
$ response = curl_exec ($ curl);
echo "";
}
?>