adrianTNT Posted September 15, 2007 Share Posted September 15, 2007 Can someone please point me in the right direction with this? I am trying to create two things/codes. - I have files placed like this in directories: "/files/103/", "/files/104/", "/files/105/" The directories have multiple files and directories in them. Is there a simple function to create a zip "104.zip" that contains all the files and folders in that directory keeping the directory structure? - The other thing... users upload a zip by a form, is there a function to unzip an uploaded zip in a given directory (files/104/) keeping the directory structure from the zip? Maybe there is a class or something for this? Any ideas? Thank you. Link to comment https://forums.phpfreaks.com/topic/69463-how-to-zip-a-full-directory-also-unzip-structure-of-an-uploaded-zip-file/ Share on other sites More sharing options...
Wuhtzu Posted September 15, 2007 Share Posted September 15, 2007 This would be a push in the right direction: http://no.php.net/zip Scroll down to the examples - they describe pretty much everything http://www.phpit.net/article/creating-zip-tar-archives-dynamically-php/ A tutorial found by Google.com -> php zip tutorial Link to comment https://forums.phpfreaks.com/topic/69463-how-to-zip-a-full-directory-also-unzip-structure-of-an-uploaded-zip-file/#findComment-349025 Share on other sites More sharing options...
adrianTNT Posted September 15, 2007 Author Share Posted September 15, 2007 I found many examples for the unzip thing, but the 1st issue remains, I didn't find a code sample to zip all files and folders from one given location. I tried 6-7 versions, most of them link to external files or to 10 other libraries. I do not know why people complicate things with thousands of lines, all I want is to zip a folder Link to comment https://forums.phpfreaks.com/topic/69463-how-to-zip-a-full-directory-also-unzip-structure-of-an-uploaded-zip-file/#findComment-349097 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.