How to download remote file with CURL using PHP

You can read the response and store it to the disk.
Use below code to get your job done.

<?php
	$url = 'http://yourdomain.com/path/filename.ext';
	$file_path = '/path/foldername/filename.ext';

	$fp = fopen($path, 'w'); 
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_FILE, $fp);

	$response = curl_exec($ch);
?>

That’s all. Now you can download file hassle free.