I wanted to make a image upload script in PHP, but I didn't want users to able to upload executable scripts with a .png, etc extension. Is there a way I can make a secure image upload script that only uploads images?
Thanks in advance.
The views expressed on this page by users and staff are their own, not those of NamePros.
[FONT="myriad pro, helvetica, Arial,sans-serif"]If you're looking for a full script, I have an open source one at imagepng.com. I'm about to release an update that adds user accounts so I'm looking for beta testers.[/FONT]
Make sure to always get the last extension of the uploaded filename. That means don't just explode by the periods and expect it to be the second one because hackers can just do filename.jpg.jpg.jpg.jpg.jpg.EXE
[FONT="myriad pro, helvetica, Arial,sans-serif"]If you're looking for a full script, I have an open source one at imagepng.com. I'm about to release an update that adds user accounts so I'm looking for beta testers.[/FONT]