Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
#785599
I am trying upload file using angularjs and Process maker Rest API and i got following error .


var _reqObj = new Object();
_reqObj.form = "@"+filename;
_reqObj.inp_doc_uid = 'XXXXXXXXX';
_reqObj.app_doc_comment = 'Scanned ID document';
_reqObj.tas_uid = 'XXXXXXXXXXXXX';

var requestYmc = $http({
method: 'POST',
url: $scope.serverUrl + $scope.workspace + '/oauth2/token',
data: $scope.credentials

});
requestYmc.success(function (html,status) {
$scope.AccessToken = html.access_token;
var editreqf = $http({
method: "POST",
url: $scope.serverUrl + 'api/1.0/' + $scope.workspace + '/cases/' + $scope.caseId + '/input-document',
headers: { 'Authorization': 'Bearer ' + $scope.AccessToken },
data: _reqObj
});
editreqf.success(function (html,status) {
console.log(status);
alert(status);


});
});



ERROR: file name Doesn't Exist.


please helpme any One .

Regards,
jagan
#785607
I don't think that you can upload a file with JavaScript. You can add a "submit" button and a file input to your form and then add some server-side code to send the file to PM. If you are using PHP, you can take the uploaded file from the $_FILE superglobal variable and pass it to the REST endpoint.
#785639
Hi Team,
Thank you for your response.

I have implemented the same code given by you.
Once I log into processmaker the file is being uploaded but the filename is not being correctly displayed.Instead of filename it is displaying temp name with.tmp extension.

Can you please suggest the solution

Regards
jagan

A 1xBet clone script is a customizable software so[…]

A Bustabit clone script is a pre-made software sol[…]

Are you looking for ways to pay someone to write m[…]

BC.Game Clone

BC.game clone is a replica of the original BC.game[…]