copy('http://www.google.co.in/intl/en_com/images/srpr/logo1w.png', '/tmp/file.jpeg');
or
//Get the file
$content = file_get_contents("http://www.google.co.in/intl/en_com/images/srpr/logo1w.png");
//Store in the filesystem.
$fp = fopen("/location/to/save/image.jpg", "w");
fwrite($fp, $content);
fclose($fp);
source: https://stackoverflow.com/questions/6306935/php-copy-image-to-my-server-direct-from-url/6306995
e kiwwe wena host ekaka thiyana image ekak user pc ekata download karagannada one machan ube php system eka through?
Curl walin hari file get content walin hari puluwan man hithanne..
Ehema nattham wget walata liyapu ekak athi
<?php
if(isset($_POST['url']))
{
$image = $_POST['url'];
$pathinfo = pathinfo($image);
$image_name = $pathinfo['filename'].'.'.$pathinfo['extension'];
echo '<a download="'.$image_name.'" href="'.$image.'" title="ImageName">';
echo '<img src="'. $image.'">' ;
}
?>
<form name="download" action="" method="post">
<input type="text" name="url">
<input type="submit" name="submit" value="Download">
</form>
http://www.elakiri.com/forum/images/bluesaint/misc/logo_wesak.jpg
උදාහරනයක් විදිහට මේ පින්තූරය මට පීසී එකට බා ගන්න ඕන PHP වලින්
copy('http://www.elakiri.com/forum/images/bluesaint/misc/logo_wesak.jpg', 'temp/myfolder/path/wesak.jpg');