Ok,
There is another solution here: FIle upload from a rest client to a rest server
But neither of these solutions worked for me.
However, this is what worked; actually worked.
First, I wasn't sure if my file was reaching the method, so I changed the response line to:
function enter_post()
{
$this->response($_FILES);
}
Note, this is a great way to test your REST methods.
You can also output:
$this->response($_SERVER);
and
$this->response($_POST);
etc.
I got the following JSON output:
{"file":{"name":"camel.jpg","type":"application/octet-stream","tmp_name":"/tmp/phpVy8ple","error":0,"size":102838}}
So I knew my file was there.
I then changed the method to find and move the file. I used common file access script to get the file from its temp location and move it to a new location:
$uploaddir = '/home/me/public_html/uploads/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
$data['status'] = 'uploaded';
} else {
$data['status'] = 'failed';
}