Answer the question
In order to leave comments, you need to log in
How to download voice from VK to the server?
Current code -
<?
if($data->object->message->attachments[0]->type == 'audio_message') {
$owner_id = $data->object->message->attachments[0]->audio_message->owner_id;
$fileName = "{$owner_id}.mp3";
$urlFile = $data->object->message->attachments[0]->audio_message->link_mp3;
file_put_contents('./'.$fileName, file_get_contents("{$urlFile}"));
print_r($fileName);
unlink($fileName);
}
Warning: file_get_contents(): Filename cannot be empty in /sites/dsada/photo.php on line 5
.mp3
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question