I want to upload image in my database. I want to upload that image with some form element. but i don't know how can i do that. my Controller is there.
public function createAction() {
if ($this->request->isPost()) {
$blog = new Blogs();
$blog->assign(array(
'title' => $this->request->getPost('title', 'striptags'),
'description' => $this->request->getPost('description'),
//here i want to add upload image...
));
//get current user name
$blog->name = $this->getName();
//var_dump($blog);exit;
if (!$blog->save()) {
$this->flash->error($blog->getMessages());
} else {
$this->flash->success("Blogs was created successfully");
Tag::resetInput();
}
}
$this->view->form = new BlogsForm(null);
}