lewisstevens1 Posted September 12, 2013 Share Posted September 12, 2013 Hey guys does anyone know why this doesnt upload large files? 6/7mb... the PHP ini files seem fine... i even overdone it by upload_max_filesize = 20M; post_max_size = 20M; max_execution_time = 400; max_input_time = 400; memory_limit = 900M; was over the top but was just trying to find answer... i have the code here and attaching a full code thing. $src1 = '../../image_uploads/layout_uploads/temp/temp/'.$image_name.'.jpg'; $src2 = '../../image_uploads/layout_uploads/temp/'.$image_name.'.jpg'; // Get Rid Of Old Files unlink($src1); if(!empty($src2)){ unlink($src2); } move_uploaded_file($_FILES["img_upload"]["tmp_name"], $src1); // INIT list($old_width, $old_height) = getimagesize($src1); if($old_width > $old_height){ $total_w = $old_width; $total_h = $old_width; $image_top1 = $total_h - $old_height; $image_top2 = $image_top1 * 0.5; $image_top = $image_top2; $image_left = 0; } else { $total_w = $old_height; $total_h = $old_height; $image_left1 = $total_w - $old_width; $image_left2 = $image_left1 * 0.5; $image_top = 0; $image_left = $image_left2; } $create_bg = imagecreatetruecolor($total_w,$total_h); // Full Blue // CREATE WHITE BG $white = imagecolorallocate($create_bg, 255, 255, 255); imagefilledrectangle($create_bg, 0, 0, $total_h, $total_w, $white); // GET IMAGE $create_image = imagecreatefromjpeg($src1); // CREATE IMAGE imagecopyresampled($create_bg, $create_image, $image_left, $image_top, 0, 0, $old_width, $old_height, $old_width, $old_height); // OUTPUT if(filesize($src1) > 2000000){ imagejpeg($create_bg, $src2, 60); } else if(filesize($src1) < 2000000 && filesize($src1) > 1000000){ imagejpeg($create_bg, $src2, 70); } else if(filesize($src1) < 1000000 && filesize($src1) > 100000){ imagejpeg($create_bg, $src2, 80); } else if(filesize($src1) < 100000 && filesize($src1) > 50000){ imagejpeg($create_bg, $src2, 90); } else { imagejpeg($create_bg, $src2, 95); } unlink($src1); Quote Link to comment https://forums.phpfreaks.com/topic/282112-php-file-upload/ Share on other sites More sharing options...
PravinS Posted September 13, 2013 Share Posted September 13, 2013 have u retarted the apache server after doing changes in php.ini file Quote Link to comment https://forums.phpfreaks.com/topic/282112-php-file-upload/#findComment-1449327 Share on other sites More sharing options...
lewisstevens1 Posted September 13, 2013 Author Share Posted September 13, 2013 It has updated on the server i checked via phpinfo() Quote Link to comment https://forums.phpfreaks.com/topic/282112-php-file-upload/#findComment-1449350 Share on other sites More sharing options...
mac_gyver Posted September 13, 2013 Share Posted September 13, 2013 are you sure the file isn't being upload or is it just not being resized? your code has no error checking logic in it to get it (your code) to tell you if, when, or where any part of it is failing. also, do you have php's error_reporting set to E_ALL and display_errors to ON (or log_errors to ON), to get php to report and display (or log) any errors it detects? Quote Link to comment https://forums.phpfreaks.com/topic/282112-php-file-upload/#findComment-1449365 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.