Asheeown Posted January 31, 2007 Share Posted January 31, 2007 I'm making a .csv file and I want it to be compressed to the filename.csv.gz so I have this: function compress($srcName, $dstName) { $fp = fopen($srcName, "r"); $data = fread ($fp, filesize($srcName)); fclose($fp); $zp = gzopen($dstName, "w9"); gzwrite($zp, $data); gzclose($zp); } and it works...well for the most part, when I do a file that is very large it just doesn't compress the file, it does do it for small queries such as 200,000 to 1,000,000 records but just about anything above that doesn't compress, any ideas? Link to comment https://forums.phpfreaks.com/topic/36526-compress-to-gz/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.