I created a rest server using the codeigniter rest server library created by PhilSturgeon :
github.com/philsturgeon/codeigniter-restserver
Now, I am using Codei
Simple Rest Post service to upload & store a file from any Rest client
public function product_post()
{
$uploaddir = './uploads/products/';
$file_name = underscore($_FILES['file']['name']);
$uploadfile = $uploaddir.$file_name;
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
$dataDB['status'] = 'success';
$dataDB['filename'] = $file_name;
} else {
$dataDB['status'] = 'failure';
}
$this->response($dataDB, 200);
}