I have a basic script that allows a user to bulk upload products to a database. The first step is uploading a CSV file. Once the file is uploaded, the script displays a page that enables the user to review each product and add one or multiple photos to upload for each of the products.
I am using HTML similar to the following:
<input type="file" class="form-control" name="photos[]" id="photos" multiple>
This HTML input is displayed once per product, all within one HTML form.
When I receive the submission on the server side, it is consolidating all the product photos from all the HTML inputs into one array. The problem is, I do not know which photos belong to which products.
Is there any way to resolve this issue so that I can distinguish between the photos? Each product may have multiple photos, and I'd like to upload each set from its own select box.