ccrevcypsys Posted August 13, 2007 Share Posted August 13, 2007 Someone let me know why this wont write to the database? if(is_array($_FILES['imageName'])){ $date_str=date('Ymdhis'); $imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$_FILES['imageName']['name'])); $imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$_POST['imageName'])); if($imageFormat == "JPG" || $imageFormat == "JPEG" || $imageFormat == "PNG" || ($imageFormat == "GIF" && $config['gdGifSupport']==1)){ copy($_FILES['imageName']['tmp_name'],"images/uploads/".$date_str."_".str_replace('-','_',str_replace(' ','_',$_FILES['imageName']['name']))); if(is_array($_FILES['imageName_thumb'])){ copy($_FILES['imageName_thumb']['tmp_name'],"images/uploads/thumbs".$date_str."_".str_replace('-','_',str_replace(' ','_',$_FILES['digitalSample']['name']))); $record["image"] = $db->mySQLSafe("images/uploads/thumbs".$date_str."_".str_replace('-','_',str_replace(' ','_',$_FILES['imageName']['name']))); }} } Quote Link to comment https://forums.phpfreaks.com/topic/64740-solved-uploading-image/ Share on other sites More sharing options...
hitman6003 Posted August 13, 2007 Share Posted August 13, 2007 What errors are you getting, if any? Is part of the script executing properly and only the DB part failing? Is the file uploading at all? What are you trying to insert into the DB? The file, or the file's location? What is the field type that you are inserting into? If you are inserting the image, it has to be BLOB, other wise a character type. You need to provide us more information than "Why isn't it working?". Quote Link to comment https://forums.phpfreaks.com/topic/64740-solved-uploading-image/#findComment-322957 Share on other sites More sharing options...
ccrevcypsys Posted August 13, 2007 Author Share Posted August 13, 2007 ok well sorry about that I got it to post so i solved it my self now im just working on the thumbnail creation look at my newest post plz Quote Link to comment https://forums.phpfreaks.com/topic/64740-solved-uploading-image/#findComment-322963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.