PhpConcept

Developers Tools

  • Increase font size
  • Default font size
  • Decrease font size
Home PclZip News PclZip 2.6 : New features on individual files

PclZip 2.6 : New features on individual files

Print PDF

PclZip 2.6 introduce new granular functions at the file level. You can now add a string as a file in an archive, without the need to create temporary files when a string need to be put in a zip archive.

PclZip 2.6 also correct some bugs.

User manual is not yet updated so you can find some informations bellow :

$archive = new PclZip("archive.zip");
$v_filename = "new_file.txt";
$v_content = "This is the content of file one\nHello second line";
$list = $archive->create(array(
array(
PCLZIP_ATT_FILE_NAME => $v_filename,
PCLZIP_ATT_FILE_CONTENT => $v_content
)
)
);
if (
$list == 0) {
die(
"ERROR : '".$archive->errorInfo(true)."'");
}

The content of string "$v_contenu" will be added in the archive as a file with name 'new_file.txt'.

Last Updated on Sunday, 07 February 2010 15:24