locked
How to apply data annotation validation for HttpPostedFileBase[] for valid file type for C# MVC 5? RRS feed

  • Question

  • How to apply data annotation validation for HttpPostedFileBase[] property to valid file type in c# MVC 5?

    I have tried with [Remote], but on controller action method I am not able to get all values of files as array. I am getting only latest uploaded file as parameter. Is there any way using which i can validate file type using data annotation for multiple file having same name attribute

    Thursday, August 27, 2015 12:14 PM

Answers

All replies

  • All ASP.Net or Webtechnlogy related questions should be asked over here:

    http://forums.asp.net/

    • Proposed as answer by Just Karl Friday, August 28, 2015 4:51 PM
    • Marked as answer by Just Karl Friday, September 11, 2015 7:59 PM
    Thursday, August 27, 2015 12:24 PM
  • Hello,

    Specifically, this should be asked in the ASP.Net MVC forum on forums.asp.net.

    As Microsoft's ASP.Net forums are on a different platform, we cannot move the question for you.

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join('6D73646E5F6B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

    Friday, August 28, 2015 4:51 PM