ASP.Net MVC input file control event after file selection

I have an ASP.Net MVC application. One of my views has a input file control that users use to select a file to upload to a database. After the user selects a file but BEFORE they click the upload button, I'd like to run some code from the controller on the file. Is there a way to do this? It's a simple input control: <input type="file" name="postedfile" /> Any help is appreciated.
dodgerfanAsked:
Who is Participating?
 
Miguel OzConnect With a Mentor Software EngineerCommented:
I do not think it is possible, because your are not suppose to alter files in an external PC. (otherwise imagine the number of files people could manipulate.
If more help neede please provide answers to:
Q1. What you could do though is in the controller action run whatever you need to run in the file before saving in into your system.
What exactly are you planning to do? if it is size validation that should be easy to implement in the controller action  and just return the view with a warning message.
Q2. What code have you got so far? Controller and View/Model
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.