downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ZipArchive::addEmptyDir> <Examples
Last updated: Fri, 20 Nov 2009

view this page in

The ZipArchive class

Introduction

A file archive, compressed with Zip.

Class synopsis

ZipArchive
ZipArchive {
/* Properties */
/* Methods */
bool addEmptyDir ( string $dirname )
bool addFile ( string $filename [, string $localname ] )
bool addFromString ( string $localname , string $contents )
bool close ( void )
bool deleteIndex ( int $index )
bool deleteName ( string $name )
bool extractTo ( string $destination [, mixed $entries ] )
string getArchiveComment ( void )
string getCommentIndex ( int $index [, int $flags ] )
string getCommentName ( string $name [, int $flags ] )
mixed getFromIndex ( int $index [, int $flags ] )
mixed getFromName ( string $name [, int $flags ] )
string getNameIndex ( int $index )
string getStatusString ( void )
resource getStream ( string $name )
mixed locateName ( string $name [, int $flags ] )
mixed open ( string $filename [, int $flags ] )
bool renameIndex ( int $index , string $newname )
bool renameName ( string $name , string $newname )
mixed setArchiveComment ( string $comment )
mixed setCommentIndex ( int $index , string $comment )
mixed setCommentName ( string $name , string $comment )
mixed statIndex ( int $index [, int $flags ] )
mixed statName ( name $name [, int $flags ] )
mixed unchangeAll ( void )
mixed unchangeArchive ( void )
mixed unchangeIndex ( int $index )
mixed unchangeName ( string $name )
}

Properties

status

Status of the Zip Archive

statusSys

System status of the Zip Archive

numFiles

Number of files in archive

filename

File name in the file system

comment

Comment for the archive

Table of Contents



add a note add a note User Contributed Notes
ZipArchive
php at ianco co uk
23-Aug-2009 10:23
Has anyone had addFile working with PHP 5.2 on Windows XP?
I can create an archive and add a file, but it is always corrupt. status and numFiles are 0. These are only small files (I have tried txt and jpg).
An archive is created on disc, and has the sort of size I would expect. But trying to reopen the archive returns 19, which I believe is
ZIPARCHIVE::ER_NOZIP.
Windows also reports the file is invalid or corrupt.
addFromString works ok.

ZipArchive::addEmptyDir> <Examples
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites