cakephp - Word cannot open the file because the file format does not match the file extension -


hi working on download excel file shows following error

word cannot open file because file format not match file extension 

my code download excel in cakephp

foreach($info $absentrcrd){   $empinfo = array('sl no' => $slno++,                     'employee id' => $absentrcrd['emp_id'],                     'employee name' => $absentrcrd['employee_name'],                     'doj' => $absentrcrd['doj'],                     'departmernt' => $absentrcrd['department_name'],                                             'mobile' => (!empty($empmobile) ? $empmobile : 'na'),                     'email personal' => (!empty($absentrcrd['email_personal']) ? $absentrcrd['email_personal'] : 'na'),                     'supervisior' => $absentrcrd['supervisor_name'],                                             'supervisior mobile' => (!empty($supmobile) ? $supmobile : 'na'),                     '# days absent' => $absentrcrd['days_absent'],                     'details' => $absentrcrd['details'], }   $rpt['attachment']['file_type'] = 'application/vnd.ms-excel';            $filename = 'leavesreport_'.$frmdate.'-'.$todate.'.xls';  $rpt['attachment']['file_name'] = str_replace(' ','_',$filename);  $this->set('attachment', $rpt); 


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -