// increase memory limit to download heavy files
ini_set('memory_limit', '-1');
$url = 'https://example.com/heavy-file.psd';
$output_filename = 'my-file.psd';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, false);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
curl_close($ch);
// write the contents to a file in the same directory (provided permissions etc)
$fp = fopen($output_filename, 'w');
fwrite($fp, $result);
fclose($fp);
GZIP with cPanel
Compress the file on the server.
Extract GZIP file
gzip -d my-file.psd.gz
Extract TAR file
tar -xf my-file.tar