Embedded form - tabset with file upload(s)


I have an embedded form with a tabset that has 5 tabs. I know that based on other posts in the old forum that a tabset can cause issues with the cam variable directives. I have worked around the saving issues for text and checkboxes based on the following.

However I have an issue where I want to have multiple file upload fields (one file upload control in each tab). How do I handle the file upload for a tabset? Is the following the best approach?



Hi Greg,

Based on my own experience, the only way you will get it working is via REST calls, not via the Camunda directives.

I have implemented my own file component directive in an upload tab using these REST calls;


Get (Binary)
GET /task/{id}/variables/{varId}/data

Post (Binary)
POST /task/{id}/variables/{varId}/data

$http.post('/engine-rest/task/' + taskId + '/variables/' + name + '/data', formData,
    {transformRequest: angular.identity, headers: {'Content-Type': undefined}}

Thank you very helpful. I will try it out and let you know.

As a reference, here is my topic on the subject;

1 Like

Thank you.

How did you handle the generation of the link to the file to allow someone to dowload? I was having trouble on load of the embedded form if the file upload process variable is not set yet.

I know there is the cam directive but it appears that only works once you have posted a file and the variable is set.

Thanks for the suggestions

It is a known bug that the file download directive throws an exception when the file variable is not set as a variable.
A workaround is to add it nevertheless with a null value.

This being said you can use a button like this;

<a href="/engine-rest/task/{{camForm.taskId}}/variables/someVariable/data" class="btn btn-default" role="button">