tripwater Posted April 23, 2009 Share Posted April 23, 2009 Hello, I am taking info from a DB query, opening a file, writing to it and saving it as a .csv file. I need to then take this file and zip it in the same directory as csv file. It was requested that it be a .zip file not a .gz file. I thought maybe I could do a system( zip( "file.csv" "file.zip" ) ); Is there anything like this available or a simple solution to what I am needing? Thank you for any help with this. Link to comment https://forums.phpfreaks.com/topic/155409-solved-take-csv-file-and-zip-it/ Share on other sites More sharing options...
Bauer418 Posted April 23, 2009 Share Posted April 23, 2009 http://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS314&=&q=php+create+zip+archive&btnG=Google+Search&aq=f&oq= I hate PHPClasses personally, but the first result looks promising (I didn't look at the page at all, just the title). Link to comment https://forums.phpfreaks.com/topic/155409-solved-take-csv-file-and-zip-it/#findComment-817769 Share on other sites More sharing options...
tripwater Posted April 23, 2009 Author Share Posted April 23, 2009 I figured it out I was passing in the zip command as a function which was incorrect and also I had the file parameters backwards. It now looks like this and it works system( "zip ".$path.$FileName.".zip ".$path.$FileName.$Extension ); Link to comment https://forums.phpfreaks.com/topic/155409-solved-take-csv-file-and-zip-it/#findComment-817795 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.