Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10058 karma points MVP 2x admin c-trib
    May 14, 2018 @ 13:58
    Ismail Mayat
    0

    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

  • Daniël Knippers 121 posts 856 karma points MVP 2x c-trib
    May 15, 2018 @ 08:12
    Daniël Knippers
    0

    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

  • Ismail Mayat 4511 posts 10058 karma points MVP 2x admin c-trib
    May 15, 2018 @ 08:25
    Ismail Mayat
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft