How to keep input type=file field value after failed validation in ASP.NET MVC?

前端 未结 7 1808
闹比i
闹比i 2020-11-27 04:39

I\'ve got a simple form in an MVC app I\'ve made. It contains a file field so users can upload an image. It all works great.

Problem is, if the form submit fails val

7条回答
  •  感情败类
    2020-11-27 05:04

    If the file isn't too big you could base64 it and use this as value for a hidden field.

提交回复
热议问题