PHP Classes

creat zip file

Recommend this page to a friend!

      Zip File  >  All threads  >  creat zip file  >  (Un) Subscribe thread alerts  
Subject:creat zip file
Summary:why? the created zip file's size always 1kb?
Messages:1
Author:HuangHaifeng
Date:2012-03-21 02:31:53
 

  1. creat zip file   Reply   Report abuse  
Picture of HuangHaifeng HuangHaifeng - 2012-03-21 02:31:54
I am so sorry,I am not good at English.
So,,,perhaps ,it is hard to understand what I will say...

My php ver is PHP4.4.4

I used the code
/*

<?php
require "zip.class.php";

$zipfile = new zipfile;

$zipfile->create_dir(".");
$zipfile->create_file(file_get_contents("example.txt"), "example.txt");

// Then, for example, you could save the file as example.zip

$fh = fopen("example.zip", "wb"); // Remember to use the "b" flag when saving non-ASCII files
fwrite($fh, $zipfile->zipped_file()); // Write the contents
fclose($fh); // Close the file
?>

*/
BUT,
I dont know,I have no idea,
why the created zip file's size is always 1 kb?
is version's quetion? or what?

&#12362;&#25163;&#25968;&#12391;&#12377;&#12364;&#12289;&#12372;&#30906;&#35469;&#12398;&#12411;&#12393;&#12424;&#12429;&#12375;&#12367;&#12362;&#39000;&#12356;&#33268;&#12375;&#12414;&#12377;&#12290;