Forum Moderators: coopster
$MIME = "application/x-gzip";
$file = gzencode($file,9);
$filename = "whatever.txt.gz";header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Type: $MIME");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . strlen($file));echo $file;
...but it refuses to work. First of all, it doesn't suggest the correct file name when saving. And, sometimes the download just fails entirely.