Saving a File or Webpage using PHP
Feb 28, 2008 · 1 minute readCategory: php
This is post is now quite old and the the information it contains may be out of date or innacurate.
If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub
Here is my simple function for doing just that.
function save_external_resource($resource, $filename){
$data = fopen($resource, 'r');
file_put_contents($filename, $data);
}
You can save any kind of resource from anywhere on the web that you have access to and save it locally.
For large files you may need to edit your php.ini and increase the resource limits and max execution time.