hello everyone i want validate the type of file being uploaded on sever to .txt extension. Can i use accept attribute of input element to filter out the type of file. If yes how can i do that and if any other way ??
Some code is
<input type="file" name="uploadfile" value="" size="50" />
Thanks
here is javascript custom validation
And yes you can use accept attribute as well:
However as far as I know it is not supported by IE and Safari
But please make sure to validate the uploaded file on the server side as well. Just client validation is not enough.