1 Replies - 1793 Views - Last Post: 28 March 2013 - 07:52 AM Rate Topic: -----

#1 BarNunBoi  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 232
  • Joined: 28-March 12

CakePHP Question:How to handle file uploads from view?

Posted 16 November 2012 - 09:31 AM

Hello,
I have a webpage that allows users to upload a Excel Workbook to my database and I was wondering how do I handle the uploaded file. This is how I create my form

<?php echo $this->UiForm->create(null, array(
				'type' => 'file',
				'action' => 'processSpreadsheet',
			)); ?>		
				<?php echo $this->UiForm->input('Spreadsheet', array(					
					'label' => '',
					'rel'=>'tooltip',
					'title' => 'Choose a completed workbook template from your local system to import.',
					'data-trigger'=>'hover',
					'type' => 'file',
				)); ?>
			<?php echo $this->UiForm->end(array('label' =>'Upload' ,'class'=>'btn', 'id'=>'upload-doc' )); ?>


With that said, I have already wrote a function that will read the workbook. I just need to know how to handle the file from the view. Any input would be greatly appreciated! Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: CakePHP Question:How to handle file uploads from view?

#2 BarNunBoi  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 232
  • Joined: 28-March 12

Re: CakePHP Question:How to handle file uploads from view?

Posted 28 March 2013 - 07:52 AM

If I'm not mistaken and please correct me if I'm wrong but data passed in to the controller from the view forms is stored in $this->data. Please correct me if I'm wrong. Hope this helps someone in the future!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1