i have the following script for file download.
function download(){
$this->file = $this->getFile();
if($this->filesize <= 0 || $this->filesize == null){
echo $this->filesize;
} else {
set_time_limit(0);
header('Content-Description: File Transfer');
header('Content-type:'.$this->contenttype);
header('Content-Disposition: attachment; filename='.$this->filename.'.'.$this->extension);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
ob_end_clean();
readfile('/upload/'.$this->fileUid.'.'.$this->extension);
}
die();
}
when i try to download file with small size (in Kbs) file(s) download successfully, but if file size is large i.e greate than 1MB, then file does not downloads properly, the downloaded files size is in Kbs, and files does not open either. Can any one kindly help me in this regards, i tried ob_end_clean()
but did not work. Kindly help me.
Regards,
Warning: readfile(/home/totalrec/upload/c924b6aa211faf2706e89abd3aaeea29.pdf) [function.readfile]: failed to open stream: No such file or directory in /home/totalrec/public_html/test1/classes/file.class.php on line 418
is the content of file. – Shahzeb Khan Oct 23 '13 at 21:04