I've got a page where the user can upload an image which is later saved on the server. I'm doing simple validation of the uploaded file by checking its extension (.jpg, .png, etc.)
Is such validation enough for server security? Or does this leave the opportunity for someone to upload malicious code which can harm my server? If it is possible to validate the uploaded images, how it can be done?