bobinindia Posted April 11, 2008 Share Posted April 11, 2008 My php.ini is set to 32M. Why might my uploads be failing when they are more than about 200k? Link to comment https://forums.phpfreaks.com/topic/100645-solved-upload-over-200k-doesnt-work/ Share on other sites More sharing options...
friedemann_bach Posted April 11, 2008 Share Posted April 11, 2008 Could you describe the problem more precisely? This can have various errors. Link to comment https://forums.phpfreaks.com/topic/100645-solved-upload-over-200k-doesnt-work/#findComment-514724 Share on other sites More sharing options...
poleposters Posted April 11, 2008 Share Posted April 11, 2008 post your upload script Link to comment https://forums.phpfreaks.com/topic/100645-solved-upload-over-200k-doesnt-work/#findComment-514749 Share on other sites More sharing options...
bobinindia Posted April 11, 2008 Author Share Posted April 11, 2008 The script is a bit long as it does some other stuff. $filename = 'upload'; $description = 'description'; if (isset($_FILES['upload']) ) { if (!empty($_POST['description'])) { $d = "'" . escape_data($_POST['description']) . "'"; } else { $d = 'NULL'; } //Add the record to the database $query = "INSERT INTO uploads (file_name, file_size, file_type, description) VALUES ('{$_FILES['upload']['name']}', '{$_FILES['upload']['size']}', '{$_FILES['upload']['type']}', $d)"; $result = mysql_query ($query); if ($result) { $upload_id = mysql_insert_id(); if (move_uploaded_file($_FILES['upload']['tmp_name'], "../../externals/uploads/$upload_id")) { $picid = "../../externals/uploads/$upload_id".".jpeg"; define ("WIDTH", "600"); define ("HEIGHT", "600"); $img_name = $pic_id; function make_thumb($img_name,$filename,$new_w,$new_h) { $src_img=imagecreatefromjpeg($img_name); $old_x=imageSX($src_img); $old_y=imageSY($src_img); $ratio1=$old_x/$new_w; $ratio2=$old_y/$new_h; if($ratio1 > $ratio2) { $thumb_w=$new_w; $thumb_h=$old_y/$ratio1; } else { $thumb_h=$new_h; $thumb_w=$old_x/$ratio2; } $dst_img=imageCreateTrueColor($thumb_w,$thumb_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); imagejpeg($dst_img,$filename); imagedestroy($dst_img); imagedestroy($src_img); } $thumb_name="resized/".$upload_id.".jpeg"; $filename = $thumb_name; $thumb=make_thumb("../../externals/uploads/$upload_id",$thumb_name,WIDTH,HEIGHT); copy($thumb_name, "ImageEditor/edit/$upload_id".".jpeg"); copy($thumb_name, "ImageEditor/original/$upload_id".".jpeg"); copy($thumb_name, "ImageEditor/active/$upload_id".".jpeg"); ob_end_clean(); $picname = $upload_id.".jpeg"; header ("Location: ImageEditor/index.php?imageName=$picname"); } else { echo '<p><font color="red">File number could not be moved.</font></p>'; $query = "DELETE FROM uploads WHERE upload_id = $upload_id"; $result = mysql_query($query); //Add more error reporting if needed. } } else { //I the query did not run ok echo '<p><font color="red">Your submission could not be completed due to system error. Ooops.</font></p>'; //Print the query and invoke the mysql_error() function to debug. } } // end of Isset Link to comment https://forums.phpfreaks.com/topic/100645-solved-upload-over-200k-doesnt-work/#findComment-514808 Share on other sites More sharing options...
bobinindia Posted April 11, 2008 Author Share Posted April 11, 2008 it was a width problem. not size Link to comment https://forums.phpfreaks.com/topic/100645-solved-upload-over-200k-doesnt-work/#findComment-514901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.