php upload from url

Solutions on MaxInterview for php upload from url by the best coders in the world

showing results for - "php upload from url"
Luciano
07 Jun 2018
1<?php
2if(isset($_POST['get_image']))
3{
4 $url=$_POST['img_url'];
5 $data = file_get_contents($url);
6 $new = 'images/new_image.jpg';
7 file_put_contents($new, $data);
8 echo "<img src='images/new_image.jpg'>";
9}
10?>