venkir Posted July 13, 2006 Share Posted July 13, 2006 Hi:In my php I am creating two files, both contain the output desired in different format, one in xml and one as plain csv. Let us say they are called abc.xml and abc.csv. These two files are created in a 'uploads' dir in the web server. I would next like to include these two files into a new ZIP archive called 'output.zip' or 'output'gz' (don't care). I read all about the zlib functions, but to me ot looks like when you open the file for writing you can use either fopne or gzopen. My problem is if I use gzopen I will still end up with two files (although they will now be zipped) and I cannot download two files using the 'force donwload' method. My ultimate aim is when the user clicks 'Save files' the force download method will download the 'output.gz' file, provides capability to the user to save it wherever they want in the local file system. Once they have save and they unzip this file they can extract abc.xml and abc.csv.How do I do this? Thanks for your time in advance.-Venki Quote Link to comment https://forums.phpfreaks.com/topic/14444-how-to-create-a-zip-archive-of-two-files/ Share on other sites More sharing options...
tomfmason Posted July 13, 2006 Share Posted July 13, 2006 Not sure man. But I have been studing up on this very same thing. Here is a link that maybe of some help[url=http://www.zend.com/zend/spotlight/creating-zip-files1.php?article=creating-zip-files3&kind=sl&id=2607&open=1&anc=0&view=1#Heading1]http://www.zend.com/zend/spotlight/creating-zip-files1.php?article=creating-zip-files3&kind=sl&id=2607&open=1&anc=0&view=1#Heading1[/url]Hope That Helps. Good Luck Quote Link to comment https://forums.phpfreaks.com/topic/14444-how-to-create-a-zip-archive-of-two-files/#findComment-57123 Share on other sites More sharing options...
zq29 Posted July 13, 2006 Share Posted July 13, 2006 A guy over at smiledsoft.com has written a class for creating compressed archives within PHP. I've used it within several projects, does the job nicely. Quote Link to comment https://forums.phpfreaks.com/topic/14444-how-to-create-a-zip-archive-of-two-files/#findComment-57276 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.