Welcome Guest, Not a member yet? Register   Sign In
[Solved] Codeigniter downloading file dangerous warning message
#1

(This post was last modified: 09-29-2017, 01:55 AM by wolfgang1983.)

When I download my PHP Excel file my internet security says this is a dangerous file but it is not.

Question is there any where in the code below that might be causing this warning from my McAfee security? How to stop it so does not detect it as a dangerous file.

[Image: 3c2Yrdmw6wlG.png]

Thank you for your time.

PHP Code:
<?php

class Events extends MX_Controller {

    public function 
generate_excel() {

        
$query $this->db->get('event');
        
$excelresults $query->result_array();

        require (
APPPATH 'third_party/PHPExcel-1.8/Classes/PHPExcel.php');
        require (
APPPATH 'third_party/PHPExcel-1.8/Classes/PHPExcel/Writer/Excel2007.php');

        
$objPHPExcel = new PHPExcel();

        
$objPHPExcel->getProperties()->setCreator("");
        
$objPHPExcel->getProperties()->setLastModifiedBy("");
        
        
$objPHPExcel->getProperties()->setSubject("");
        
$objPHPExcel->getProperties()->setCreator("");
        
$objPHPExcel->getProperties()->setDescription("");

        
$objPHPExcel->setActiveSheetIndex(0);

        
$objPHPExcel->getActiveSheet()->SetCellValue("A1"'Event');
        
$objPHPExcel->getActiveSheet()->SetCellValue("B1"'Event Title');
        
$objPHPExcel->getActiveSheet()->SetCellValue("C1"'Event Date');
        
$objPHPExcel->getActiveSheet()->SetCellValue("D1"'Event Start Time');

        foreach (
range('A'$objPHPExcel->getActiveSheet()->getHighestDataColumn()) as $col) {
 
       $objPHPExcel->getActiveSheet()
 
               ->getColumnDimension($col)
 
               ->setAutoSize(true);
 
       

        
$excelrow 2;

        foreach (
$excelresults as $excelresult => $excelvalue) {
            
$objPHPExcel->getActiveSheet()->SetCellValue("A" $excelrow$excelvalue['event']);
            
$objPHPExcel->getActiveSheet()->SetCellValue("B" $excelrow$excelvalue['event_title']);
            
$objPHPExcel->getActiveSheet()->SetCellValue("C" $excelrow$excelvalue['event_date']);
            
$objPHPExcel->getActiveSheet()->SetCellValue("D" $excelrow$excelvalue['event_start_time']);
        
            
$excelrow++;
        }

        
$filename 'Bowling-Events-For-' date('Y') . '.xlsx';
        
$objPHPExcel->getProperties()->setTitle("Riwaka Bowling Club Events");

        
header('Content-Type: application/vnd.ms-excel'); 
        
header('Content-Disposition: attachment;filename="'.$filename.'"');
        
header('Cache-Control: max-age=0'); 
        
$objWriter PHPExcel_IOFactory::createWriter($objPHPExcel'Excel2007');
        
$objWriter->save('php://output');
    }



Attached Files
.php   Events.php (Size: 2.04 KB / Downloads: 60)
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

It looks like a localhost xampp issue.

I tried with vHost and now the error goes away.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB