ID: 50349 User updated by: c dot hugot at uniteam dot fr Reported By: c dot hugot at uniteam dot fr -Status: Feedback +Status: Open Bug Type: Zip Related Operating System: windows xp with wamp PHP Version: 5.3SVN-2009-12-01 (SVN) New Comment:
In the code $_SESSION['step5'][$p_sName . '_name'] is the name of the file, that is in the archive file ($_SESSION['step5']['zip_name'] . ".zip" = the name of the archive file), and RACCORDEMENT_ZIP_FILE_PATH is the constant, that contained the path to the archive file. I hope, that could help you to solve my problem. Thanks for your work. Best regards. Previous Comments: ------------------------------------------------------------------------ [2009-12-01 08:58:03] j...@php.net Is that self-contained? I don't have your session available. ------------------------------------------------------------------------ [2009-12-01 08:53:46] c dot hugot at uniteam dot fr <?php private function myDelZipFile($p_sName){ $l_oZip = new ZipArchive(); if($l_oZip->open(RACCORDEMENT_ZIP_FILE_PATH . "/" . $_SESSION['step5']['zip_name'] . ".zip", ZIPARCHIVE::OVERWRITE) === true){ $l_oZip->deleteName( $_SESSION['step5'][$p_sName.'_name']); $l_oZip->close(); return true; } return false; } ?> ------------------------------------------------------------------------ [2009-12-01 08:49:00] j...@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2009-12-01 08:45:39] c dot hugot at uniteam dot fr Description: ------------ I create an archive (.zip) with class ZipArchive, with four files into. And when I want to delete the last file, in this archive, the function deleteName() return true, but the file is not remove from the archive. The three others files were correctly remove, but not the last. Reproduce code: --------------- --- >From manual page: function.ziparchive-deletename --- private function myDelZipFile($p_sName){ $l_oZip = new ZipArchive(); if($l_oZip->open(RACCORDEMENT_ZIP_FILE_PATH . "/" . $_SESSION['step5']['zip_name'] . ".zip", ZIPARCHIVE::OVERWRITE) === true){ $l_oZip->deleteName( $_SESSION['step5'][$p_sName . '_name']) === true; $l_oZip->close(); return true; } return false; } Expected result: ---------------- The archive file ever contained the last file. Actual result: -------------- The archive would be empty. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50349&edit=1