Answer the question
In order to leave comments, you need to log in
How to download a photo to the server from vk?
This is what the response looks like when sending a message with a photo
"type": "message_new",
"object": {
"message": {
"date": 1628863980,
"from_id": 123,
"id": 30430,
"out": 0,
"peer_id": 123,
"text": "",
"conversation_message_id": 17348,
"fwd_messages": [],
"important": false,
"random_id": 0,
"attachments": [
{
"type": "photo",
"photo": {
"album_id": -7,
"date": 1605377976,
"id": 457254130,
"owner_id": 123,
"has_tags": false,
"access_key": "123,
"sizes": [
{
"height": 97,
"url": "http://fdsfsldkfskldfsd.jpg",
"type": "m",
"width": 130
},
{
"height": 300,
"url": "https://sun9dasdsa",
"type": "x",
"width": 400
}
$url = $data->object->message->attachments[0]->photo->sizes->height[300]->url;
и через if($height=='300)
Answer the question
In order to leave comments, you need to log in
How to select biggest photo in vk api photos.get array?
be sure to read the comments
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question