cortez Posted July 8, 2010 Share Posted July 8, 2010 Hello all. Hoping someone could help me modify this bit of code. <?php //create the directory if doesn't exists (should have write permissons) if(!is_dir("./files")) mkdir("./files", 0755); //move the uploaded file move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']); chmod("./files/".$_FILES['Filedata']['name'], 0777); ?> I am much better with flash then php but I'm learning. This script is from a tutorial. It is protected through flash no problem but I want to make sure it is okay through the php as well. It's for a CMS I built and I only need it to allow .jpg images nothing else. Can someone lend a hand in pointing me in the right direction? Thanks Link to comment https://forums.phpfreaks.com/topic/207175-upload-security/ Share on other sites More sharing options...
AbraCadaver Posted July 8, 2010 Share Posted July 8, 2010 http://us.php.net/manual/en/function.mime-content-type.php or PHP 5.3: http://us.php.net/manual/en/function.finfo-file.php Link to comment https://forums.phpfreaks.com/topic/207175-upload-security/#findComment-1083256 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.