I have the following HTML
code:
<table>
<tr>
<td>Your photo file</td>
<td ><input id="EmpSelfPhoto" type="file" /></td>
<td style='color:red'>Not requiered</td>
</tr>
<tr>
<td>Your CV file</td>
<td><input id="EmpCV" type="file" /></td>
<td style='color:red'>Requiered</td>
</tr>
<tr>
<td></td>
<td><input id="PostFile" type="button" value="Upload .." /></td>
<td></td>
</tr>
</table>
And I'm using Jquery ajax -generic handler
to upload the posted files.
The problem is context.Request.Files.Count
will validate for all inputs and I have to loop throw all input using HttpFileCollection
.
How can I validate each file input separately in server side? For example I would like to check if file input 1 has file, and check if file input 2 is a valid picture.