5000000) { $tmpfile=$_FILES['upl']['tmp_name']; @unlink($_FILES['upl']['tmp_name']); $isgone=file_exists($tmpfile); echo '{"status":"Error: Image file size exceeds 5MB !","imgurl":"","iwidth":"","iheight":"","thecount":"","badurl":"", "img":"", "extension":"","hcid":""}'; exit(); } $updir=dirname( __FILE__ ); $updir=$updir."/ad_uploads"; $imgurl="/include/analytics/adrotation/ad_uploads/".$_FILES['upl']['name']; $ipath="//include/analytics/adrotation/ad_uploads/"; $imgpath=$updir."/".$_FILES['upl']['name']; $imgname=$_FILES['upl']['name']; if(!is_dir($updir)) { if(!mkdir($updir,0777)){echo '{"status":"System Error: Please try again. If error persists, please contact bateworld customer satisfaction !","imgurl":"","iwidth":"","iheight":"","thecount":"","badurl":,"hcid":""}';exit();} } if(move_uploaded_file($_FILES['upl']['tmp_name'], $updir."/".$_FILES['upl']['name'])){ //strip image of Exif data - which can be corrupt // use copy and then create thumbnail $iname = pathinfo($imgpath); $iname=$iname['filename']; $full=$updir."/".$iname."_full.".$extension; $medium=$updir."/".$iname."_medium.".$extension; $thumbnail=$updir."/".$iname."_thumbnail.".$extension; $image = new Imagick($imgpath); $image->stripImage(); // Writes resultant image to output directory //$image->writeImage($full); $image->destroy(); //resize image $size = getimagesize($imgpath); $owidth=$size[0]; $oheight=$size[1]; include("resize-class.php"); $width=$owidth; $height=$oheight; $urlissue=0; echo '{"status":"success","imgurl":"'.$ipath.'","iname":"'.$iname.'","iwidth":"'.$width.'","iheight":"'.$height.'","thecount":"","badurl":"", "img":"", "extension":"","hcid":""}'; exit(); // insert image details into database table } } echo '{"status":"error general","imgurl":"","iwidth":"","iheight":"","thecount":"","badurl":"", "img":"", "extension":"","hcid":""}'; exit();