Tell me what's wrong I try to do that would be loaded 1-5 pictures but one is loaded and all the others are not
function load($src){ $photo = (array)$this->getPhoto($src); $photo[$this->owner['type']] = $this->owner['value']; $data = $this->vk->get('photos.saveWallPhoto', $photo); return $data; } private function getPhoto($src){ file_put_contents($name, file_get_contents($src)); $ch = curl_init($this->getServer()); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data")); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'file1' => '@/путь/vkAPI/tests/1.png','file2' => '@/путь/vkAPI/tests/5.png' )); $response = curl_exec( $ch ); curl_close( $ch ); return json_decode($response); } private function getServer(){ $data = $this->vk->get('photos.getWallUploadServer', array( $this->owner['type'] => $this->owner['value'], )); return $data->response->upload_url; }