If I have an input element, for example:
<input type="file" multiple="multiple" name="file1" />
and select several files, the browser creates several files with the same element 'file1' name. This is similar to multiple list selection.
So, how can I capture this in ASP.NET using the Request.Files collection? The Request.Files.AllKeys collection displays all the files, but the key values ββare the same. Request.Files returns a string for each key, but I can only get the first file using the key:
var file = Request.Files["file1"];
This gives me the first file, but I cannot access the others also selected this way, since they do not have a unique name. The iteration also does not work, since Request.Files returns keys, not actual file entries.
How to capture these secondary files in ASP.NET?
source share