I want to upload a file like this:
<input type="file" name="uploadPicture"/>
Is there any way to find out in javascript if the selected file is a valid image?
I know that I can check the file extension. The problem with that is someone can change a .txt
file to .jpg
and it would pass the validation.