Strange characters after extension creating zip file in php

  iis, php, windows, zip, ziparchive

when a zip file creation script is called the file created has some random characters at the end, Like this ‘data.zip8Cp785Cd’

   $dir ='../data/data/';
$destination = $dir.'data.zip';

$zip = new ZipArchive();
if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {
    echo "Error";
}
$zip->addFile('./data/data.txt','datafile.txt');
$zip->close();

Source: Windows Questions

LEAVE A COMMENT