#32274 [NEW]: Can't create zip file
| From: | jmcgutana at alliedbank dot com dot ph | Date: | Fri, 11 Mar 2005 04:59:54 +0000 |
| Subject: | #32274 [NEW]: Can't create zip file | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-75229@lists.php.net to get a copy of this message | ||
From: jmcgutana at alliedbank dot com dot ph
Operating system: Linux Fedora Core
PHP version: 4.3.8
PHP Bug Type: *Compression related
Bug description: Can't create zip file
Description:
------------
I am using the class 'zipfile' I found from Zend.com to create zip files.
It works well with files smaller than 1 megabyte in size. But when I
tried to zip a file larger than 1 mb, it doesn't produce the zip file.
Reproduce code:
---------------
<?php require("ZipFile.inc.php"); #from Zend.com
$zipfile = new
ZipFile();
$zipfile->add_dir("./");
$file =
"ATD34501-030705V.208.00"; #some file here..
$fp = fopen($file, "r");
$filedata = "";
if($fp) {
$filedata = fread($fp, filesize($file));
fclose($fp);
}
print "\nfile
opened..\n";
$zipfile->add_file($filedata, basename($file));
print "\nfile added in
zip..\n";
$ftpdir =
"/var/ftp/pub/031105"; #ftp directory
$fname = "test.zip"; #zipfile name
$fp =
fopen("$ftpdir/$fname", "w+");
if($fp) {
fwrite($fp, $zipfile->file());
fclose($fp);
}
?>
Expected result:
----------------
test.zip file
Actual result:
--------------
no file created
--
Edit bug report at http://bugs.php.net/?id=32274&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32274&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32274&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32274&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32274&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32274&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32274&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32274&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32274&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32274&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32274&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32274&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32274&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32274&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32274&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32274&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32274&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32274&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32274&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32274&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32274&r=mysqlcfg