Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

By rohitambre
Hi everyone,

I want to use Processmaker's REST APIs to perform all activities of process. Processmaker's documentation is quite good and I am able to perform actions but I'm stuck at file upload from single, multi file and grid file upload.

I read other posts about the same and I am also using ExtraRest plugin which is really very helpful but I was unable to find an API to upload files only through any javascript Frontend library.

Can anyone help me for FIle upload from REST endpoints.
User avatar
By programerboy
You can use a code like this:
Code: Select all
function uploadInputDocument($caseId, $taskId, $inputDocId, $inputDocComment, $filePath)
	$aVars = array(
	   'inp_doc_uid'     => $inputDocId,
	   'tas_uid'         => $taskId,
	   'app_doc_comment' => (!empty($inputDocComment)?$inputDocComment:'This is from webserice!'),
	   'form'            => (phpversion() >= "5.5") ? new CurlFile($filePath) : '@' . $filePath
	return pmRestRequest('POST', $_SERVER['HTTP_HOST'], '/api/1.0/'.config("system.workspace").'/cases/'.$caseId.'/input-document', $aVars);

$document = uploadInputDocument($caseId, $taskId, $inputDocId, 'your file comment', 'your path file');
if($document->status == 200){
	echo 'ERROR UPLOAD<br/>';
} ... 1iw/videos

There's no way to do that. The only way to do so i[…]

Hello, If you are using a version of ProcessMak[…]

I really appreciate the work you did. I got to kno[…]

cam on