I'm busy coding a PHP file for secure file uploading of images such as .jpg, .jpeg, .png, .bmp, and .gif
Here is the code:
$realname = $_FILES['userfile']['name'];
if(!preg_match("/(\.jpg|\.png|\.gif|\.bmp|\.jpeg)$/i",$realname)) {
die();
}
Is there a way to bypass this check to be able to upload a .php file? I've heard of the file.php%00.jpg trick, but that is secured from. Does anyone know of any other methods? Or is the code above safe?