Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php [vtiger][Webservice]无法在vtigercrm的文档模块中使用Webservice数据库创建文档执行请求的操作时出错_Php_Web Services_File Upload_Vtigercrm - Fatal编程技术网

Php [vtiger][Webservice]无法在vtigercrm的文档模块中使用Webservice数据库创建文档执行请求的操作时出错

Php [vtiger][Webservice]无法在vtigercrm的文档模块中使用Webservice数据库创建文档执行请求的操作时出错,php,web-services,file-upload,vtigercrm,Php,Web Services,File Upload,Vtigercrm,我正在研究vtigercrm的web服务,我想使用web服务在vtigercrm 6.5的文档模块中创建文档,如何在vtigercrm的文档模块中创建新文档 我创建了一个PHP文件,在其中我创建了一个表单,用于在中创建一个组织,我还想创建一个文档。因此,我还设置了该表单中的文件上传输入标记,并将所有数据发布到url.php,在其中设置数组并将参数传递给 $params = array( 'notes_title'=>$accountname, 'filesize' =

我正在研究vtigercrm的web服务,我想使用web服务在vtigercrm 6.5的文档模块中创建文档,如何在vtigercrm的文档模块中创建新文档

我创建了一个PHP文件,在其中我创建了一个表单,用于在中创建一个组织,我还想创建一个文档。因此,我还设置了该表单中的文件上传输入标记,并将所有数据发布到url.php,在其中设置数组并将参数传递给

$params = array(

     'notes_title'=>$accountname,
     'filesize' => $filesize,
     'filetype' => $filetype,
     'filename'=>$filename,
     'assigned_user_id'=>$assigned_user);
并对它们进行编码

$objectJson = Zend_JSON::encode($params);
设置模块名

$moduleName = 'Documents';
设置参数和操作

 $params = array("sessionName"=>$sessionId, "operation"=>'create', "element"=>$objectJson, "elementType"=>$moduleName);
$httpc->post($endpointUrl.$urlArgs,$params,true); $response=$httpc->currentResponse()

但在这里,当我打印$response时,我会得到这个错误消息

  [body] => {"success":false,"error":{"code":"DATABASE_QUERY_ERROR","message":"Database error while performing requested operation"}}
继续代码:

   $jsonResponse = Zend_JSON::decode($response['body']);
   $savedObject = $jsonResponse['result'];
在这里,我编写了获取文件名、大小和类型的代码

if($_FILES['fileToUpload']['name'] != ''){
$errCode=$_FILES['fileToUpload']['error'];
    if($errCode == 0){
        foreach($_FILES as $fileindex => $files)
        {
            if($files['name'] != '' && $files['size'] > 0){
                $filename = $_FILES['fileToUpload']['name'];
                $filename = from_html(preg_replace('/\s+/', '_', $filename));
                $filetype = $_FILES['fileToUpload']['type'];
                $filesize = (string)$_FILES['fileToUpload']['size'];
                $filelocationtype = 'I';
                $binFile = sanitizeUploadFileName($filename, $upload_badext);
                $filename = ltrim(basename(" ".$binFile)); //allowed filename like UTF-8 characters
            }
        }

    }
}
当我在vtigercrm中运行代码时,我将失败的arror消息写入日志

Query Failed:UPDATE vtiger_notes SET filename = ? ,filesize = ?, filetype = ? , filelocationtype = ? , filedownloadcount = ? WHERE notesid = ?::->[1048]Column 'filesize' cannot be null
我认为错误显示“filesize”列不能为null

但在上面的代码中,我已经得到了一个文件的大小,并且已经传递到了查询中。那我为什么会犯这个错误

我试过很多次了,任何人都可以帮我解决这个问题

提前感谢,等待正面回复