class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Warning: copy(https://www.lc.nl/incoming/e5m6zi-201506114440.jpg/ALTERNATES/LANDSCAPE_768/201506114440.jpg): failed to open stream: HTTP request failed! HTTP/1.1 426 Upgrade Required in /home/theolodewijk/domains/theolodewijk.nl/public_html/themes/theolodewijk/news-crawler/test.php on line 75
$add_post_url = your remote file $format = explode(".",$add_post_url); $path = '../uploads/posts/'.$randomizer.'.'.array_pop($format).''; copy(''.$add_post_url.'', ''.$path.''); $handle = new upload($path);include './../vendor/autoload.php'; $add_post_url = $image_url; $format = explode(".", $add_post_url); $path = $themes_path . '/img/news-crawler/' . $chat_id . '/test/' . array_pop($format) . ''; copy('' . $add_post_url . '', '' . $path . ''); $handle = new upload($path);