Wednesday, January 13, 2016

Download File Remotely

<?php /* Download a file remotely */$target_file = "/home/ism-apac/Desktop/Test/test.jpg";
$url = "https://nthm3.s3.amazonaws.com/catalog/o/48631a.jpg";

try{
file_put_contents($target_file, fopen($url, 'r'));
}
catch(Exception $e)
{
  echo $e->getMessage();
}
?>

No comments:

Post a Comment