Hi Camunda Community,
I’m working on uploading multiple files to an embedded form in my Camunda Spring Boot application. I’ve managed to successfully select and submit multiple files, but when I check the payload in the network tab (F12), the form variables are displayed correctly, but the document variables are not appearing in the payload.
Here’s the relevant code from my form:
html
Copier le code
<input id="files" type="file" multiple />
And the JavaScript code I’m using to handle the files:
javascript
Copier le code
var files = document.getElementById('files').files;
for (let index = 0; index < files.length; index++) {
let file = files[index];
let reader = new FileReader();
reader.onload = function(event) {
console.log(event.target.result);
variableManager.createVariable({
name: 'document_' + index,
type: 'Bytes',
value: event.target.result,
valueInfo: {
filename: file.name,
mimetype: file.type
}
});
};
reader.readAsArrayBuffer(file);
}
Despite using this code, the document variables are not being created in the payload. Has anyone faced a similar issue or has any suggestions on how to ensure that the document variables are correctly included in the form payload?
Thank you for your help!