0

I've a situation where I am downloading a zip and need to rename one of it's folders before I extract it. Is this possible using PCLZip?

atwellpub
  • 5,660
  • 11
  • 38
  • 52
  • AFAIK it is a restriction of the zip file format that this would not be possible without unpacking and repacking (although I could be wrong). Why rename it *before* though - surely you can just extract and then rename and move around to your hearts content, please explain what has caused you to conclude that you need to do things in this order? – DaveRandom Jun 30 '12 at 20:03
  • Well it's complicated. I've a zip file with a directory structure like this: /folder1/folder2/ and I am downloading it from a file called ./folder3/update.php . I'm trying to drop folder1 from the archive upload all the contents to ../ and have the folder2 overwrite the files in folder3 instead of create a ./folder2 file in ../ – Hudson Atwell Jul 01 '12 at 19:50

1 Answers1

0

You can simply remove all the folder locations from each file using this PCLZIP_OPT_REMOVE_ALL_PATH

Regards.

AbdulBasit
  • 1,269
  • 11
  • 19