Hello everyone,
I am trying to complete user tasks with having a file as an input but I haven’t understood exactly how I am supposed to handle this.
In the example process of the “invoice” I see that there are variables with file as value. (invoiceDocument) .
I am using a react application and I am completing user tasks using rest apis.
Can you help me achieve this?
Thank you!!
Hi @konkouts,
Uploading files via Camunda’s REST API uses multipart form submits for variables of type file. I’m not very familiar with React, but I’m certain that there is a way of sending multipart form requests using react.
1 Like
Thanks for the reply @StephanHaarmann .
I am trying to do this firstly by sending requests from Postman.
The process instance is at a user task and I am trying to complete this like this:
POST: engine-rest/task/{taskId}/complete
Content-type: multipart/form-data
Body → form-data → key: test (file) and for value I choose a file from my local pc “fs3.txt” and is displayed as " om6Eul_Mk/fs3.txt "
But the response is :
{
“type”: “NotSupportedException”,
“message”: “RESTEASY003065: Cannot consume content type”,
“code”: null
}
Am I doing something wrong? Any help can be important!
Thank you