ccrevcypsys Posted September 4, 2007 Share Posted September 4, 2007 shouldnt this be working? <?php $record["image"] = $db->mySQLSafe($_POST['imageName']); if(is_array($_FILES['imageName'])){ $date_str=date('Ymdhis'); $imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$_FILES['imageName']['name'])); if($imageFormat == "JPG" || $imageFormat == "JPEG" || $imageFormat == "PNG" || ($imageFormat == "GIF" && $config['gdGifSupport']==1)){ copy($_FILES['imageName']['tmp_name'],"images/uploads/".$date_str."_".str_replace(' ','_',$_FILES['imageName']['name'])) or die("| copy error |"); $record["image"] = $db->mySQLSafe($date_str."_".$_FILES['imageName']['name']); copy($_FILES['imageName']['tmp_name'],"images/uploads/thumbs/thumb_".$date_str."_".str_replace(' ','_',$_FILES['imageName']['name'])) or die("| copy 2 Thumb error |"); if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$date_str."_".$_FILES['imageName']['name'])){ @chmod($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$date_str."_".$_FILES['imageName']['name'], 0775); unlink($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$date_str."_".$_FILES['imageName']['name']); } $thumb=new thumbnail("images/uploads/".$date_str."_".$_FILES['imageName']['name']); // see if we need to resize if(($size[0] > $config['gdthumbSize']) OR ($size[1] > $config['gdthumbSize'])){ $thumb->size_auto($config['gdthumbSize']); } else { $thumb->size_auto($size[0]); } $thumb->jpeg_quality($config['gdquality']); $thumb->save("images/uploads/thumbs/thumb_".$date_str."_".$_FILES['imageName']['name']); } } ?> ... <tr> <td class="tdText" align="left" valign="top" width="25%"> <strong> Image: </strong> <br> <!--(Optional and thumbnails will automatically be made IF the format chosen is compatible.)--> </td> <td valign="top"> <div id="selectedImage"> </div> <div id="imageControls"> <table border="0" cellpadding="3" cellspacing="0"> <tbody> <tr> <td> <input name="image" style="width: 200px;" class="submit" type="file" id="image" /></td> </tr> </tr> </tbody> </table> </div> </td> </tr> ... no errors it just doesnt upload anything Quote Link to comment https://forums.phpfreaks.com/topic/67921-solved-image-upload/ Share on other sites More sharing options...
sstangle73 Posted September 4, 2007 Share Posted September 4, 2007 what errors are you getting?>? Quote Link to comment https://forums.phpfreaks.com/topic/67921-solved-image-upload/#findComment-341376 Share on other sites More sharing options...
ccrevcypsys Posted September 4, 2007 Author Share Posted September 4, 2007 none it just doesnt upload anything. Quote Link to comment https://forums.phpfreaks.com/topic/67921-solved-image-upload/#findComment-341377 Share on other sites More sharing options...
sstangle73 Posted September 4, 2007 Share Posted September 4, 2007 you should put the <?php tags around the php its eaiser to read and debug but it think this is over my head sorry! Quote Link to comment https://forums.phpfreaks.com/topic/67921-solved-image-upload/#findComment-341379 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.