Jump to content

tarcinil

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tarcinil's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am just posting this as I hate when I find these so high on google without a resolution. To fix this, you must specify the flags as create or overwrite. $zipFile->open("download.zip", ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE); Example: function zip_magento() { $zip = new ZipArchive() ; $opened = $zip->open($this->export_dir.'client_'.$this->uniqueID.'/all.zip', ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ); if( $opened !== true ){ echo("cannot open $filename for writing."); } //if ($zip->open($this->export_dir.'client_'.$this->uniqueID.'/all.zip',ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE) !== TRUE) { // echo ("Could not create archive"); //} foreach($this->files as $k=>$data){ $zip->addFile($data); } $zip->close();
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.