# Error while submitting multiple files

**URL:** <https://forum.communityhealthtoolkit.org/t/error-while-submitting-multiple-files/2465>\
**Category:** Technical Support\
**Tags:** forms, cht-4\
**Created:** [February 13, 2023, 9:03am UTC](https://forum.communityhealthtoolkit.org/t/error-while-submitting-multiple-files/2465 "2023-02-13T09:03:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkesh](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/gkesh/32/1313_2.png) [@gkesh](https://forum.communityhealthtoolkit.org/u/gkesh)\
**Post date:** [February 13, 2023, 9:03am UTC](https://forum.communityhealthtoolkit.org/t/error-while-submitting-multiple-files/2465/1 "2023-02-13T09:03:14Z")

</div>

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.

 ![Screenshot from 2023-02-13 13-10-27](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/1/143860070572c82b03dd432d30038d9032243849.png)

Please let me know if you need further context.

cc: @sanjay @gaarimasharma @binod @yuv

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 13, 2023, 1:02pm UTC](https://forum.communityhealthtoolkit.org/t/error-while-submitting-multiple-files/2465/2 "2023-02-13T13:02:58Z")

</div>

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](https://github.com/medic/cht-core/issues/8072)

---

<div class="post-metadata">

**Author:** ![gkesh](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/gkesh/32/1313_2.png) [@gkesh](https://forum.communityhealthtoolkit.org/u/gkesh)\
**Post date:** [February 14, 2023, 6:16am UTC](https://forum.communityhealthtoolkit.org/t/error-while-submitting-multiple-files/2465/3 "2023-02-14T06:16:10Z")

</div>

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.
