function delete($id) { $upload = $this->findById($id); if (!$upload) { return $this->cakeError('object_not_found'); } // Delete DB record first if (parent::delete($upload[$this->name]['id'])) { $path = Configure::read('Wildflower.uploadDirectory') . DS . $upload[$this->name]['name']; $this->_deleteFiles($path); return true; } return false; }