Home » File Formats » Archive_Zip » Bug #7494
Failure adding files to existing archives
Details
| Submitted | 2006-04-26 18:25 UTC |
|---|---|
| From | martin at kp3 dot de |
| Status | Suspended |
| Package | Archive_Zip |
| PHP Version | 5.0.4 |
| OS | Linux RHES 3 |
| Roadmaps | (Not assigned) |
Comments
[2006-04-26 18:25 UTC] martin at kp3 dot de
Description:
------------
If you try to put some new files to an existing archive with the method 'add', the method fails with an error.
Test script:
---------------
$zipfile = new Archive_Zip('test.zip');
$msc_return = $zipfile->add(
array('_data/00000034.pdf', '_data/00000038.pdf'),
array('remove_all_path' => true)
);
unset($zipfile);
$zipfile = new Archive_Zip('test.zip');
$zipfile->add(
array('_data/00000097.pdf', '../_data/00000101.pdf'),
array('remove_all_path' => true)
);
echo "<h1>File 2</h1><code>".$zipfile->errorInfo(true)."</code>";
Expected result:
----------------
First the zip file will be created and in the second step the new files should be put into the existing zip archive.
Actual result:
--------------
The zip file in step 1 is created and then it returns the following error:
ARCHIVE_ZIP_ERR_READ_OPEN_FAIL (-2) : Unable to open temporary file 'archive_zip-444fa3e2c1b0c.tmp' in binary write mode
[2006-04-26 19:41 UTC] martin at kp3 dot de
I have seen that creating the temp file is the problem. Due to the definition of constant 'ARCHIVE_ZIP_TEMPORARY_DIR' in the zip class file it is not possible to change this configuration in use.
I would prefer to write the temp file in the same directory where actual archive is located. In this folder writing should be possible. Another way to fix this problem could be using the $ENV-Tempfile. But the second version could return problems using the safe mode.
As change request i would prefer a optional configure-array in the constructor of the object to set this and any other options.