Part of the EllisLab Network
   
 
Zip class fails to download a file if the file is around 400Kb or more
Posted: 08 February 2008 05: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 03: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
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 119762 Total Logged-in Users: 29
Total Topics: 125937 Total Anonymous Users: 3
Total Replies: 662564 Total Guests: 371
Total Posts: 788501    
Members ( View Memberlist )
Newest Members:  frostiexadamsmithdj1White HattkatimariedelcaljeffewensJuan AlumadontheobaldBCFEA2FBS