Sorted few guidelines.
If you request it more than once per 30 mins they block your ip for 3 hours so ive put in a test url where can put there file someone on your server to text and then a live link when you are ready.
You can put in the assets directory and allow in your htaccess maker, name the file something random. Or put in any directory and alter the path to the file, personally prefer the later its easier.
// Where you want to save the file to, currently defaulted to the directory of this script
$dir = dirname(__FILE__);
$zipfile = 'http://www.domain.com/GeoIP.dat.gz';
// LIVE LINK $zipfile = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz';
file_put_contents('geoip.gz', file_get_contents($zipfile));
$sfp = gzopen('geoip.gz', 'rb');
$fp = fopen('GeoIP.dat', 'w');
while ($string = gzread($sfp, 4096)) {
fwrite($fp, $string, strlen($string));
}
gzclose($sfp);
fclose($fp);
if (is_file('geoip.gz')) {
unlink('geoip.gz');
}
?>