使用slim框架上传图像以及其他文本数据的REST服务

i been trying to make image uploading along with other text data and to put image in one folder that have to be reference with one id field of database.

i am using Slim framework for this rest api services. These are my codes

$app->post('/ProjectBook', function() use ($app) {
            verifyRequiredParams(array('flat_no', 'customer_name', 'status','photoid'));
            $response = array();
            $flat_no = $app->request->post("flat_no");
                        $customer_name = $app->request->post('customer_name');
                        $photoid = $app->request->post('photoid');
                        move_uploaded_file($_FILES["file"]["temp_name"], 'folders'.$photoid.'/'.$_FILES["file"]["name"]);
                        $data = array($flat_no,  $customer_name, $status, $photoid);   
            $db = getConnection();

                        $stmt = $db->prepare("INSERT INTO projectbook(flat_no, customer_name, status, photoid ) VALUES( ?, ?, ?, ?)");
            $res = $stmt->execute($data);
                            if ($res != NULL) {
                            $response["error"] = false;
                            $response["message"] = "submited successfully";

                             echoRespnse(201, $response);
                            } else {
                            $response["error"] = true;
                            $response["message"] = "Failed to insert data. Please try again";
                            echoRespnse(200, $response);
                            }  

           });

And i am using curl to test it

$curl -X POST -F "photoid=@pic.php" -F "flat_no=4&customer_name=yes&status=booked" http://localhost/Api_service/ProjectBook

but it doesn't work. Return my validation api of {"error":true,"message":"Required field(s) customer_name, status, photoid is missing or empty...."}

How can i perform this process?