Storing an image from URL in a file using PHP
It can be simply done by two PHP functions file_put_contents and file_get_contents.
$urlToImage = 'http://www.example.com/image.gif'; $pathToStore = '/my_folder/my_image.gif'; file_put_contents( $pathToStore, file_get_contents( $urlToImage ) );
It can work if allow_url_fopen configuration directive is set as true.