Answer the question
In order to leave comments, you need to log in
VK API to upload a lot of photos to an album (restriction is triggered and photos are lost)?
I'm trying to upload photos to an album and then attach them to posts. 10 posts with 5-10 photos per post. VK has a limit of 5 photos at a time. I'm uploading 1 photo at a time, then the next one... Using the code from the last comment from Anonymous Anonymous here How do I upload photos to a VKontakte group album? , slightly modifying it for themselves.
In the loop, I go around the array of posts, then the loop of the array of pictures. I download each one separately. For this I call:
$upload_server = $this->apiRequest('photos.getUploadServer', $data);
https://pu.vk.com/c637916/upload.php?act=do_add&mid=4488320&aid=244178381&gid=147188527&hash=5c1f8c13c3b1fc0960dca09070a65d39&rhash=89056ea5afaa464efd22821a50df2fd4&swfupload=1&api=1
(
[server] => 637916
[photos_list] => [{"photo":"ad9c7a5747:z","sizes":,"kid":"6bba8744f1326a9392b95c954925552b","debug":"xszmzxzyzzzozpzqzrz"}]
[aid] => 244178381
[hash] => bb87694c04dde19c550fb96c353f6e2b
[gid] => 147188527
)
(
[response] => Array
(
[0] => Array
(
[pid] => 456239270
[id] => photo4488320_456239270
[aid] => 244178381
[owner_id] => -147188527
[user_id] => 4488320
[src] => https://pp.userapi.com/c637916/v637916320/5d25f/8zrcadbGivE.jpg
[src_big] => https://pp.userapi.com/c637916/v637916320/5d260/Sqq6-7EgVVo.jpg
[src_small] => https://pp.userapi.com/c637916/v637916320/5d25e/lAaBU1AFbgs.jpg
[src_xbig] => https://pp.userapi.com/c637916/v637916320/5d261/VKuA8whyUoM.jpg
[src_xxbig] => https://pp.userapi.com/c637916/v637916320/5d262/_u7tbmXNTk8.jpg
[width] => 862
[height] => 624
[text] => Экшн-камера Firefly 6S, съемка в 4К
[created] => 1495435197
)
)
)
Answer the question
In order to leave comments, you need to log in
Defeated the problem: 414 Request-URI Too Long nginx/0.3.33
Remade the get request for photo.save into a post request.
p.s. Thank you all for your help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question