0

How do I rename the files I add to the archive? I have tried the following and it adds a file to the archive but I can't figure out how do rename.

$archive = new PclZip('archive.zip');
$list = $archive->add($filepath);

I know that I can use PCLZIP_ATT_FILE_NAME and PCLZIP_ATT_FILE_NEW_FULL_NAME but the example below uses $archive->create, not $archive->add.

http://www.phpconcept.net/pclzip/news

Peter Karlsson
  • 403
  • 5
  • 19

1 Answers1

0

I think I can answer my own question. I share it if someone else have the same problem.

$list = $archive->add(array(array(PCLZIP_ATT_FILE_NAME => $filepath,PCLZIP_ATT_FILE_NEW_FULL_NAME => $new_filepath)));
Peter Karlsson
  • 403
  • 5
  • 19