0

我在 php 中创建了这个 http 请求,它将上传的文件发送到 bonitasoft,我没有从 http 请求中得到任何错误,并且我成功地将文件上传到了我的计算机,但是 bonitasoft 通过这个请求获取了一个空文件。我不能使用 CURL。

$data1 = array(
"caseId"=> $case_id[1],
"file"=> basename($_FILES['file_attach']['name']),
"name"=>"doc_Invoice",
"fileName"=>"document_1.png",
"description"=> "draft" );
    //Structure of process data to start case with document
        $options1 = array(
        'http' => array(
        'method'  => 'POST',
        'header'=>  "POST /bonita/API/bpm/caseDocument  HTTP/1.1\r\n".
                    "Host: localhost\r\n".
                    "Cookie: ". $display[1]."\r\n".
                    "Content-Type: application/json\r\n" .
                    "Accept: application/json\r\n".
                    "Cache-Control: no-cache\r\n".
                    "Pragma: no-cache\r\n".
                    "Connection: close\r\n\r\n",
         'content' => json_encode($data1)
            )
        );
        //decode process data and adds document to case
        $url1 = "http://localhost:8081/bonita/API/bpm/caseDocument/";
        $context1  = stream_context_create($options1);
        $result1 = file_get_contents($url1, false, $context1);
        $response1 =  json_decode($result1);
        echo print_r($response1);




This is the reponse i get from the http request
( [id] => 12 [creationDate] => 2015-05-26 09:57:41.218 [author] => 4 [index] => -1 [contentMimetype] => [caseId] => 33 [description] => draft [name] => doc_Invoice [fileName] => document_1.png [isInternal] => true [submittedBy] => 4 [url] => documentDownload?fileName=document_1.png&contentStorageId=12 [contentStorageId] => 12 [version] => 1 )
4

1 回答 1

0

我想到了 。Bonita 限制对您使用的每个路径的访问,除了 bonita 租户文件夹

于 2015-05-26T16:02:22.977 回答