Error while submitting multiple files

Hi everyone,

In our most recent implementation, our team was using CHT 4.1.0 instead of the usual CHT 3.17.1. Here, our form designers used a loop to generate multiple file upload fields to get images based on the number provided by the user.

Here is a comprehensive look at the whole process:
Step 1: Enter the number of images you want to upload in the image_count input field
Step 2: Use image_count value to generate image upload fields, i.e. if input to image_count is 3, three image upload fields are rendered.
Step 3: Upload files to all the rendered image upload fields
Step 4: Press Submit to upload form

The form fails to submit with the message Error Saving Report. And in the console, the following error can be seen. The upload fields are rendered as needed but the form does not submit at all.

Note: The issue only occurs when we add more than one images. If you enter 1 in the image_count field and upload only 1 image, it generates no errors and the form submits as expected. It only happens for 2 or more image upload fields.

Please let me know if you need further context.

cc: @sanjay @gaarimasharma @binod @yuv

1 Like

Hi @gkesh

Thanks for reporting.
I can replicate this error and have logged an issue to get it fixed: Error when saving form with repeated upload inputs · Issue #8072 · medic/cht-core · GitHub

1 Like

Thank you for your quick reply @diana. I will follow the issue in Github, so please tag me if you need any further information on the matter.