I am using Activiti Rest API for fetching, initiating and completing the task. I have my own form UI and there is file attachment field. I am hitting "http://localhost:8080/activiti-app/api/enterprise/task-forms/'+taskId for completing the task. I tried to convert file into JSON text but it gives me bad request error. So what can be solution to upload file as an attachment of a form field via my servlet.