I have some files with the same keys in Request.Files object and when I use this code Request.Files.Keys["keyName"] it returns just one file but I have more than one file with that key. what should I do?! By the way I can't use key names as argument because I don't know what key exactly is, maybe model binder can help in this case but I don't know how can I use it for Files. Thanks
you try this:
for (int i = 0; i < Request.Files.Count; i++)
{
if (Request.Files.GetKey(i) == "keyName")
{
HttpPostedFileBase fileUpload = Request.Files.Get(i);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With