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:
<http://www.php.net/echo> echo $this->Form->input('image',
<http://www.php.net/array> 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
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.