I have the follow code in my Controller, which is getting values from the dropbox chooser.
<?php class DropboxboxfilesController extends AppController {
public function add() {
if ($this->request->is('post')) {
$this->request->input('json_decode');
$this->Dropboxfile->create();
if ($this->Dropboxfile->save($this->request->data)) {
$this->Session->setFlash(__('Your file has been liberated :)'));
$this->redirect($this->referer());
} else {
$this->Session->setFlash(__('Something went wrong!'));
}
}
}}?>
However, when I am getting the error that the add function does not exist when I hit submit on the submit button for the chooser.
I have tried several things but nothing seems to be working so far.
EDIT: View code
<?php echo $this->Form->create('Dropboxfile', array ('array' => 'file')); ?>
<input type="dropbox-chooser" name="selected-file" style="visibility: hidden;"/>
<?php echo $this->Form->end('Finish'); ?>
The dropbox code I am using https://www.dropbox.com/developers/dropins/chooser/js
EDIT
<form action="/cake/homes" array="file" id="DropboxfileIndexForm" method="post" accept- carset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/></div><input type="dropbox-chooser" name="selected-file" style="visibility: hidden;"/>
<div class="submit"><input type="submit" value="Finish"/></div></form