Liquid Fire Posted May 4, 2007 Share Posted May 4, 2007 I have already run this command to change the default so that zip does not copy directories when created a zip file. This is the commands i ran to change the evirement variable. ZIPOPT="-D" export ZIPOPT then in php i do this: $command = "zip {$downloadFile} {$pdfFile}"; system($command); this does not work. i even tried doing it with -D like: $command = "zip -D {$downloadFile} {$pdfFile}"; system($command); does anyone know how i can create a zip file in linux command line with it not copying the directory structure. Quote Link to comment https://forums.phpfreaks.com/topic/49996-zipping-a-file-in-command-line-under-linux/ Share on other sites More sharing options...
effigy Posted May 4, 2007 Share Posted May 4, 2007 You could try: $command = "ZIPOPT='-D'; export ZIPOPT; zip {$downloadFile} {$pdfFile}"; Quote Link to comment https://forums.phpfreaks.com/topic/49996-zipping-a-file-in-command-line-under-linux/#findComment-245460 Share on other sites More sharing options...
Liquid Fire Posted May 4, 2007 Author Share Posted May 4, 2007 nope, found out the -j does the same thing but actually works so i am just using that. Quote Link to comment https://forums.phpfreaks.com/topic/49996-zipping-a-file-in-command-line-under-linux/#findComment-245557 Share on other sites More sharing options...
448191 Posted May 4, 2007 Share Posted May 4, 2007 How about the ZipArchive extension? I've used it and it's pretty solid. No complaints whatsoever. Quote Link to comment https://forums.phpfreaks.com/topic/49996-zipping-a-file-in-command-line-under-linux/#findComment-245611 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.