Level 75
That's up to you and if only images are allowed.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
Should I validate both mimetype and the file extension? I want to allow users to upload only photos and videos.
At first I thought that if I only validate mime by extension a user would be able to simply change a pdf extension to png and he would pass validation but I checked and it doesn't work, it also finds out if it's not an actual mime type of the extension
So would that be enough to only validate by extension or I still want both?
ty
Please or to participate in this conversation.