Why is the array empty photo VK API CURL PHP?

copy($photo_url, $_SERVER['DOCUMENT_ROOT'].'/tmp/img.jpg'); //Save photo link to the server

$upload_url = json_decode(file_get_contents("https://api.vk.com/method/photos.getMessagesUpload...".$token))->response->upload_url; //Get address to download

$post_params = array(
'photo' => $_SERVER['DOCUMENT_ROOT'].'/tmp/img.jpg'
);

$ch = curl_init($upload_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
$response = curl_exec($ch);
curl_close($ch);

In response to receiving an empty array photo[] :(
June 26th 19 at 14:22
2 answers
June 26th 19 at 14:24
Solution
June 26th 19 at 14:26
'photo' => '@'.$_SERVER['DOCUMENT_ROOT'].'/tmp/img.jpg'

Find more questions by tags VKontaktePHP