Wednesday, February 11, 2015

I m trying to upload xlsx file in cakePHP

Hi Group,

I m trying to upload xlsx file in CakePHP

view code

<?php
            echo $this->Form->create('Program', array('action' => 'importexcel', 'type' => 'file'));
            echo $this->Form->file('Document');
            echo $this->Form->submit(__('Upload', true));

?>


With the below code in controller function i m trying to get properties of the uploaded file.


    public function importexcel()
        {

                if (isset($this->data)) {
                var_dump($this->data);
                echo 'FILES:';
                var_dump($_FILES);
                }
       }


But I see file properties as string as below.

array    'Program' =>       array        'Document' => string 'import.xlsx' (length=11)  
FILES:
array    empty  

Could anyone please suggest how can i get complete properties of input file uploaded.
So that i could use them IOFactory function of PHPExcel for uploading file.

Thank you.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: