$username = <USERNAME>;
$token = <TOKEN>;
$url= <PUT_ADDRESS_INCLUDE_FILE_NAME_AND_EXT>;
$filePath=<REAL_PATH_TO_FILE>;
$file = fopen($filePath, “r”);

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERPWD, $username . “:” . $token);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_PUT, 1);
curl_setopt($curl, CURLOPT_INFILE, $file);
curl_setopt($curl, CURLOPT_INFILESIZE, filesize($filePath));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);

$response = curl_exec($curl);
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if ($httpcode) {
echo $httpcode;
} else {
echo $error_msg = curl_error($curl);
}
curl_close($curl);