アップロードされたファイルを bonitasoft に送信するこの http 要求を php で作成しました。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 )