Use a simple method in php copy()
copy($source_url, $local_path_with_file_name);
Note: if the destination file already exists, it will be overwritten
Note: You need to set permission 777 for the destination folder. Use this method when you are downloading to your local machine.
Special Note: 777 is a permission in Unix based system with full read/write/execute permission to owner, group and everyone. In general we give this permission to assets which are not much needed to be hidden from public on a web server. Example: images folder.