在PHP中通过SOAP上传一个txt文件

I'm trying to transfer a txt file between a client and server using PHP and SOAP.
Can't transfer a txt file to sever floder. But I don't receive any errors.

My code is: Service.php

class Service 
{
    public function addFile($params) 
    {
        $uploads_dir = '/uploads';

        foreach ( $_FILES ["txt"] ["error"] as $key => $error ) {

            print_r($error);

            if ($error == UPLOAD_ERR_OK) {
                $tmp_name = $_FILES ["txt"] ["tmp_name"] [$key];
                $name = $_FILES ["txt"] ["name"] [$key];
                move_uploaded_file ( $tmp_name, "$uploads_dir/$name" );
            }
        }
    }
}

$server = new SoapServer ( 'Service.wsdl', array ('soap_version' => SOAP_1_2 ) );
$server->setClass ( 'Service' );
$server->handle ();

client.php

ini_set('soap.wsdl_cache_enabled', "0");

$soap = new SoapClient('http://xxx.xxx.xxx.xxx/Service.php');

$fullfilepath = 'D:\test.txt';
$B64File = base64_encode($fullfilepath);
$upload_url = 'http://xxx.xxx.xxx.xxx/Service.php';
$title = '';
$params = array(
        'photo'=>array('array' => $B64File),
        'title'=>$title
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_URL, $upload_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
$response = curl_exec($ch);
curl_close($ch);
$soap->addFile($params);

Any help would be much appreciated, thanks!

Are you looking for all errors? Have you checked the error log file?

e.g. in your code above I see that you are not checking the return value of curl_exec. What error are you expecting to see, if you are not logging an error explicitly?