When I upload a file from my React application to my server .NET Core api, I'm expecting a IFormFile type which should be an image. I'm validating the extension/mime type, but if the user changes, for example, an executable extension from 'executable.exe' to 'executable.png' it will pass through the validation! I searched a lot looking for a solution, I couldn't find any answer that suits my needs, I will keep looking, but meanwhile if someone already solved this kind of issues please let me know the better way to handle with this validation, avoiding answers that rely on getting the file extension whether the mime type.
Thanks all that can help!