PHP CURL PUT из пути к файлу

Я пытаюсь сделать CURL PUT с файлом, но у меня проблемы.

Вот мой код:

$url_path_str = 'http://my_url'; $file_path_str = '/my_file_path'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, ''.$url_path_str.''); curl_setopt($ch, CURLOPT_PUT, 1); $fh_res = fopen($file_path_str, 'r'); $file_data_str = fread($fh_res, filesize($file_path_str)); curl_setopt($ch, CURLOPT_INFILE, $fh_res); curl_setopt($ch, CURLOPT_INFILESIZE, filesize($file_path_str)); fclose($fh_res); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $curl_response_res = curl_exec ($ch); 

Сценарий держит время, и я не уверен, почему.

Я был бы признателен за помощь. Благодарю.