Asheeown Posted April 11, 2007 Share Posted April 11, 2007 I have a csv file being made by a mysql query and I want it to be gzipped for download, is their a php command for this? Link to comment https://forums.phpfreaks.com/topic/46535-solved-gzip-a-csv-file-with-php/ Share on other sites More sharing options...
Asheeown Posted April 11, 2007 Author Share Posted April 11, 2007 Anyone? gzip a csv, anyone Link to comment https://forums.phpfreaks.com/topic/46535-solved-gzip-a-csv-file-with-php/#findComment-226588 Share on other sites More sharing options...
btherl Posted April 11, 2007 Share Posted April 11, 2007 If you're using unix, you may want to call the external gzip command exec("gzip $file"); If that's available, it's by far the easiest way. The compressed file will be named "$file.gz". Make sure that you validate $file if it comes from data sent by the user, otherwise they can easily hack your site. Link to comment https://forums.phpfreaks.com/topic/46535-solved-gzip-a-csv-file-with-php/#findComment-226594 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.