0

I think this is a two-in-one question.. one, is: How do you filter valid file types in a FileDialog for a Html page?

Im using ASP.NET MVC and currently showing the textbux/browse button this way:

<%= Html.TextBox("Order.LoanInfo.FilePath", null, new { style = "width: 800px;", type = "file" })%>

and the second is : How could you do to filter the file dialog depending on the selection of a dropdownlist? I assume it would involve some jQuery and changing the attributes of the input in the DOM, but I dont really know what would need to be done.

Thanks!

Francisco Noriega
  • 13,725
  • 11
  • 47
  • 72

1 Answers1

0

There was a question like this earlier today.

There is not a consistent way to accomplish this the way you are wanting to without adding dependencies.

You may be able to make use of the accept attribute of the input tag, but browser support for this is lacking. See this question for more information.

Community
  • 1
  • 1
JonathanK
  • 3,000
  • 1
  • 20
  • 20