php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40278 Added files are corruped.
Submitted: 2007-01-29 20:42 UTC Modified: 2007-01-29 21:58 UTC
From: ssites at nanlucian dot com Assigned:
Status: Closed Package: Zip Related
PHP Version: 5.2.0 OS: Windows XP SP2
Private report: No CVE-ID: None
 [2007-01-29 20:42 UTC] ssites at nanlucian dot com
Description:
------------
I create the archive but when I open it, the file(s) is (are) corrupted.
With path or without path (at the first parameter), the file(s) is corrupted.

Reproduce code:
---------------
<?php
$zip = new ZipArchive;
$res = $zip->open('test.zip', ZipArchive::CREATE);
if ($res === TRUE) {
   $zip->addFile('Untitled-1.jpg', 'Untitled-1.jpg');
   $zip->close();
   echo 'ok';
} else {
   echo 'failed';
}
?>

Expected result:
----------------
I expect to open and extract the file(s) successfully.

Actual result:
--------------
The file(s) from created archive is (are) corrupted.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-29 20:52 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-01-29 21:58 UTC] ssites at nanlucian dot com
10X. It's working with the latest version.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 16:01:23 2020 UTC