I have on my form 3 file upload controls. Each one is mandatory has a 5mb limit set and only allows jpg. If say i pick one jpg and for other 2 fields pdfs. Then i submit form for the 2 pdf ones after postback i rightly see error message saying invalid file type. However first item which was valid is no empty i have to pick the image again.
Yeah your right on that one. I have made js changes so I prevent users from submitting unless its the right file type. Size I cannot do much about as that needs to happen server side.
Mutiple file upload fields issue
I have on my form 3 file upload controls. Each one is mandatory has a 5mb limit set and only allows jpg. If say i pick one jpg and for other 2 fields pdfs. Then i submit form for the 2 pdf ones after postback i rightly see error message saying invalid file type. However first item which was valid is no empty i have to pick the image again.
Anyone seen this before?
Regards
Ismail
Is it not the case that browsers never remember the contents of an
<input type="file">
, so after a postback all file-uploads are always empty?This post on StackOverflow also seems to indicate that. If this is default browser behavior I don't think we can change it.
https://stackoverflow.com/questions/967916/how-to-keep-input-type-file-field-value-after-failed-validation-in-asp-net-mvc
Regards, Daniël
Yeah your right on that one. I have made js changes so I prevent users from submitting unless its the right file type. Size I cannot do much about as that needs to happen server side.
Regards
Ismail
is working on a reply...