I created a rest server using the codeigniter rest server library created by PhilSturgeon :
github.com/philsturgeon/codeigniter-restserver
Now, I am using Codei
After searched for more than 1 days, finally this is what worked for me
public function upload_post()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = '*';
$this->load->library('upload');
$this->upload->initialize($config);
if ( ! $this->upload->do_upload('file'))
{
$error = array('error' => $this->upload->display_errors());
print_r($error);
// $this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
print_r($data);
// $this->load->view('upload_success', $data);
}
}