Part of the EllisLab Network
   
 
Zip class fails to download a file if the file is around 400Kb or more
Posted: 08 February 2008 06:54 PM   [ Ignore ]  
Summer Student
Total Posts:  1
Joined  02-03-2008

/*
Could anybody give me some advice, I’ve encountered that CI Zip class fails to download a file if the file is around 400Kb or more, for smaller files it works perfectly, to isolate the problem I’ve put the code that fails on a simplistic script. To run this code, copy Zip.php and this script to your htdocs folder and run it from there.
*/


<?php

  require ‘Zip.php’;

  $zip = new CI_Zip();

  $path = ‘C:/Temp/Jpg/BigFile.jpg’;  // Points to the file we want to zip.

  $zip->read_file($path , TRUE );

  //
  // This always work.
  //
  $zip->archive( ‘C:/Temp/my_backup.zip’ );

  //
  // This fails if the file is around 400Kb or more.
  //
  $zip->download(‘my_backup.zip’);

?>

Profile
 
 
Posted: 30 June 2009 04:54 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Avatar
Total Posts:  12
Joined  03-24-2008

You might take a look at your PHP memory limit as zipping takes place in RAM and not on disk. However, if you plan to zip really big files, this is not the best solution.

Does anybody know how to generate and send a zip stream?

—-
Peter

Profile