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. 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}"; 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. 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. 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
Archived
This topic is now archived and is closed to further replies.