I currently get the extension of the files are uploaded by the admins using pathinfo($FILE["name"], PATHINFO_EXTENSION)
, validating them if they match with a specific list.
Today I was wondering:
- is there any way to fake the exstension, giving the opportunity to a spiteful person to upload a script or whatever instead of, for example, a .jpg file?
- If so, how you could I prevent that or how could I strengthen my script to make it more difficult?