apache - PHP Script for Downloading more than 2GB Image ZIP -
on server created zip file images..size of zip more 2 gb. want download zip file.. times file downloading stops or fails when using below script. had change server variables..
if (!$filename) { // if variable $filename null or false display message echo $err; } else { // define path download folder plus assign file name $ordercode = $_get['ordercode']; $refid = $_get['refid']; $path = 'files/'.$refid.'/'.$ordercode.'/'.$filename; // check file exists , readable if (file_exists($path) && is_readable($path)) { // file size , send http headers $size = filesize($path); header('content-type: application/octet-stream'); header('content-length: '.$size); header('content-disposition: attachment; filename='.$filename); header('content-transfer-encoding: binary'); // open file in binary read-only mode // display error messages if file can´t opened $file = @ fopen($path, 'rb'); if ($file) { // stream file , exit script when complete fpassthru($file); exit; } else { echo $err; } } else { echo $err; } }
try writing below 2 lines above code:
ini_set('max_execution_time', 10000);//you can change value ini_set("memory_limit", "6400m");//you can change value
Comments
Post a Comment