|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-11 10:36 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 04:00:02 2025 UTC |
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