php - How to upload larger sized images -
so wrote code below
if($_files!=null && $_post!=null){ $file = $_files["image"]["tmp_name"]; if(!isset($file)){ echo "please upload image"; }else{ $image = addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name = addslashes($_files['image']['name']); $type=$_post['type']; $image_size = getimagesize($_files['image']['tmp_name']); if($image_size==false) echo "that's not image."; else { if(!(mysql_query("insert store (name,image,type) values ('$image_name','$image','$type')"))) echo "problem uploading image"; else { $lastid = mysql_insert_id(); echo "image uploaded. <p /> image: <p /> <img id='imageid' src=get.php?id=$lastid>"; } } } }
when try upload images larger ~1m script breaks.
i've google , tried modifying "php.ini" , tried changing mysql table type largeblob nothing worked.
so how do ?
when add mysql_error give me "got packet bigger 'max_allowed_packet' bytes"
http://www.youtube.com/watch?v=cxy3fr9dohi here's code's narrator. i've found on youtube.
Comments
Post a Comment