Download file from URL


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2. // DOWNLOAD REMOTE FILE
  3. // this is a-lot more complicated than it looks
  4. // $url is the url of the file, must have fopen wrappers enabled
  5. // $dir is the directory to save the file to relative to the current working directory
  6. // file is saved with the same file name from its source
  7. function getfile($url, $dir){
  8. file_put_contents($dir.substr($url,strrpos($url,'/'),strlen($url)), file_get_contents($url));
  9. }
  10. ?>

URL: http://phelps.impactwow.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.