i'm currently developing a website where the user is able to upload a valid image and not any other file types for security purposes. Atm i have this code but the image extension could still be tampered.
if (extension == ".jpg" || extension == ".jpeg" || extension == ".JPG" || extension == ".gif" || extension == ".png"
Is there any way to make absolutely sure that only these image formats are allowed and that they cannot be altered (like a global code for each format). Thanks