new UPLOAD (url)

See all posts Reply

new UPLOAD (url) new!
by Erkan, 11 years, 5 months ago
how can i upload an url like this http://www.example.com/img/myprofil.jpgReply
Re: new UPLOAD (url) new!
by mons, 11 years, 5 months ago
$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);
Reply
Re: new UPLOAD (url) new!
by Theo, 4 years ago
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

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);
Reply
Re: new UPLOAD (url) new!
by colin, 4 years ago
In your code, you are not actually fetching the image, since there is an HTTP error. Make sure your call to copy() actually retrieves the file.Reply