Using Java Servlet 3.0 file upload, how can I get the names of files when I only know the name of the input? For instance, I will have several inputs which are type="file", and will have the multiple attribute. At the time I'll need the file names, I'll know the input name, but I won't know the file names. I know how to get a file name from the header with substring, I just don't know how to get it from a specific input. It doesn't matter what order I get the filenames, I just need them from the correct input and put into an array for later processing. I've been stuck on this for about 3 weeks and can't find an answer, which probably means I'm looking for the wrong thing.
My inputs will be like this:
<input type="file" name="pic1" multiple="multiple">
<input type="file" name="pic2" multiple="multiple">
<input type="file" name="pic3" multiple="multiple">
And the code: