Skip to content

Cannot rename temp file to save on saveAsFile #54

@htcrkrishnamoorthy

Description

@htcrkrishnamoorthy

Just using below lines to add another file to existing ZIP

$destination = "C:/wamp64/www/oc3/test.zip";
$zipFile = new \PhpZip\ZipFile();
$zipFile->openFile($destination);
$retValue = $zipFile->addFile("backup.log");
$zipFile->saveAsFile($destination);
$retValue = $zipFile->close();

When it comes saveAsFile. it gives access denied error by rename() function on line 1614 of ZipFile.php where you are trying to rename temp file to ZIP. The folder has full access permission. May be because the $destination is still open in the memory and it is not able to move the file.

If I am creating a brand new zip file and use saveAsFile, it is working fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions