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? Quote Link to comment Share on other sites More sharing options...
Asheeown Posted April 11, 2007 Author Share Posted April 11, 2007 Anyone? gzip a csv, anyone Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.