Http-запрос на отправку пустого файла

Я создал этот http-запрос в php, который отправляет загруженный файл в 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 )

0

Решение

Я понял . Bonita ограничил доступ ко всем используемым вами путям, кроме папки bonita tenant

0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector