Reputation: 1
I have a simple script for eCommerce website that uploads images for products.
<input type="file" name="pictures[]" multiple="multiple" />
Everything works absolutely fine, and multiple images are uploaded at once.
However, there's one major problem. Script (or Win10 I am using) doesn't not remember which image I clicked first. It doesn't 'remember' the order. For internet stores it's extremely important to keep main image main - so main image should be a specific image out of the set of these images.
What's the solution to this?
Upvotes: 0
Views: 444
Reputation:
<input type="file" name="main" /> <input type="file" name="pictures[]" multiple="multiple" />
Upvotes: 1
Reputation: 57418
You can't leave that to the browser, as there is no standard order that's guaranteed.
What you need to do is to use two different fields:
<input type="file" name="mainpicture" />
<input type="file" name="pictures[]" multiple="multiple" />
Upvotes: 0