Unzipping with php...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Unzipping with php...

Post by jkashu »

How do I unzip a compressed folder into another directory:

Code: Select all

exec("unzip /otherdirectory/test.zip");
I tried the above line, but it only unzips the version of "test.zip" that is in the current directory.

Thanks!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

There are a ton of packages out there to do this without having to have zip compiled.

Simply type in google "php unzip", or try this http://www.vladimirated.com/downloads/unzip.lib.phps
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Including a class or two in Code Snippets.....
Post Reply