I want to create a multiple image uploader inside a form with preview and delete options. I am using php as part of my backend.
The part of the preview is easy. I've followed the explanation in
Image Upload with preview and Delete option - Javascript / Jquery
My problem comes when I want to delete an image. It is deleted from the preview but not from the e.target.files array, so when I access the variable $_FILES in php, I obtain all the images, including the ones removed.
As you can see in the picture, if I remove two images from the initial 5, there is still a message that says that I have 5 files.
I would like to know how can I remove those images completely, so in php I only access the images that have not been removed.
Thanks.