Hi friends I am working file based project in our company. When i download using below code, The model did not affect at end of download But file downloaded successfully. Ex 300Mb file take 1 hour 30 mins in client system. If i used wrong method to download the file, Please give me some idea.
$downloadlog=new Downloadlog;
$downloadlog->userid=$userid;
$downloadlog->documentid=$id;
$downloadlog->createdon=new CDbExpression('NOW()');
$ctype="application/zip";
header("Pragma: public");
header("Content-Type: $ctype");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=\"".basename($zippath)."\";");
header('Content-Length: '.filesize($zippath));
header("Content-Transfer-Encoding: binary");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
ob_clean();
flush();
readfile( $zippath);
unlink($zippath);
$downloadlog->save();
Thanks