[Vtigercrm-commits] [Vtiger development] #8235: Currupt Export ZIP Files

Vtiger development vtiger-tickets at trac.vtiger.com
Mon Sep 15 10:37:00 GMT 2014


#8235: Currupt Export ZIP Files
-----------------------+-----------------------
 Reporter:  rombach    |      Owner:  developer
     Type:  defect     |     Status:  new
 Priority:  major      |  Milestone:  6.0.0
Component:  vtigercrm  |    Version:  6.0.0 RC
 Severity:  Medium     |   Keywords:  currupt
-----------------------+-----------------------
 When i export a module i only got currupt files.
 I have a bug fix:

 The error occurred in file "vtigerCRM/vtlib/Vtiger/Zip.php"

 Only the files I downloaded were currupt, while the files in
 "vtigerCRM/test/vtlib/" were fine.

 So i took a look on the Vtiger_Zip Class.

 Here is my thoght:

 Lines 31-34

 $disk_file_size = filesize($zipfileName);
 $zipfilesize = $disk_file_size + ($disk_file_size % 1024);
 header("Content-Length: ".$zipfilesize);
 $fileContent = fread(fopen($zipfileName, "rb"), $zipfilesize);

 sould be replaced by

 header("Content-Length: ".$disk_file_size);
 $fileContent = file_get_contents($zipfileName);

 So you don't have to worry about filesize on streaming.

--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8235>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM


More information about the vtigercrm-commits mailing list