lalnfl Posted October 7, 2010 Share Posted October 7, 2010 This doesn't seem to be working. Any help? if (isset ($_POST['edit_poser'])){ $errormsg = ""; if (!$_FILES['userfile']['tmp_name']){ $errormsg = "<font style='color: #ff0000;'>Select an Image</font>"; } else { $maxfilesize = 51200; if ($_FILES['userfile']['size'] > $maxfilesize){ $errormsg = "<font style='color: #ff0000;'>Image is too large, select a smaller one</font>"; unlink($_FILES['userfile']['tmp_name']); } else if (!preg_match("/\.(gif|jpg|png)$/i" , $_FILES['userfile']['name'])){ $errormsg = "<font style='color: #ff0000;'>Image needs to be gif, jpg, or png</font>"; unlink($_FILES['userfile']['tmp_name']); } else { $newname = "image01.jpg"; $place_file = move_uploaded_file($_FILES['userfile']['tmp_name'], "Members/$id/".$newname); $errormsg = "<font style='color: #ff0000;'>Your image has successfully been updated</font>"; } } } // ends first if statement Link to comment https://forums.phpfreaks.com/topic/215310-file-uploads/ Share on other sites More sharing options...
lalnfl Posted October 7, 2010 Author Share Posted October 7, 2010 It goes through everything correctly it just doesn't place the image into the directory. What am I doing wrong? Link to comment https://forums.phpfreaks.com/topic/215310-file-uploads/#findComment-1119662 Share on other sites More sharing options...
chintansshah Posted October 7, 2010 Share Posted October 7, 2010 is the "Members/$id/".$newname $id folder is available on server? If not then create it first and give 777 permission to upload files. Link to comment https://forums.phpfreaks.com/topic/215310-file-uploads/#findComment-1119690 Share on other sites More sharing options...
phpchamps Posted October 7, 2010 Share Posted October 7, 2010 why 777??? write permission to others also ????? give 775 or 755 ..... Link to comment https://forums.phpfreaks.com/topic/215310-file-uploads/#findComment-1119738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.