It all seems so straight forward but I cannot seem to get any Image data.
Controller function is so basic:
public function beforeFilter() {
parent::beforeFilter();
$this->Uploader = new Uploader(); <- even moved this into the function itself before the Uploader->upload
}
public function admin_add() {
Configure::write('debug',2);
if (!empty($this->request->data)) {
$data = $this->Uploader->upload('image');
debug($data); <- $data is always empty
die();
}
}
Added To the top of the controller:
CakePlugin::load('Uploader');
App::import('Vendor', 'Uploader.Uploader');
Model:
public $actsAs = array( 'Uploader.Attachment');
Form:
echo $this->Form->input('image', array('type' => 'file'));
Can anyone see where I going wrong here?
I even deleted my webroot/files/uploads and I get mkdir error line 308 since its looking for that folder, so when I create it again same thing, data is empty, finds the folder but $data is Array ( [name] => [overwrite] => [multiple] => [append] => [prepend] => )
Thanks,
Dave
No comments:
Post a Comment