How can I write files in input tag?

In this code, I display images from storage. {% for car_img in car_src_images %}

The problem is there can be changes (delete, add) new images and input nothing known about it. For example, 2 images are rendered, input is empty. If add a new image it will write only added image (not rendered). So how can I trigger or write in FormData or input rendered images?

                    <div class="upload__box">
                        <div class="upload__btn-box">
                            <label class="upload__btn">
                                <p>Upload images</p>
                                <input type="file" multiple="" id="images" name="id_images" data-max_length="20" class="upload__inputfile">
                            </label>
                        </div>
                        <div class="upload__img-wrap">
                            {% for car_img in car_src_images %}
                                <div class="upload__img-box">
                                    <div style="{{ car_img.img_data }}" data-number="0" data-file="{{ car_img.img_filename }}" class="img-bg"><div class='upload__img-close'></div></div>
                                </div>
                            {% endfor %}
                        </div>
                    </div>
Back to Top