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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…