There is a picture that is available via http request
How is it possible to get a picture by running this request in php?
There is a picture that is available via http request
How is it possible to get a picture by running this request in php?
This is how I did for mp3. Similarly, you can do for pictures
private function saveCallRecord($fileLinks) { $newCallRecordContents = ''; foreach ($fileLinks as $fileLink) { $file = 'http:' . $fileLink . '&download=true'; $newCallRecordContents .= file_get_contents($file); } $file_name = $this->generateString() . '.mp3'; return ['file_name' => $file_name, 'result' => file_put_contents('./media/calls/' . $file_name, $newCallRecordContents)]; } Function copy(url_img, path_save) to help.
Source: https://ru.stackoverflow.com/questions/703361/
All Articles