pioneerx01 Posted January 7, 2012 Share Posted January 7, 2012 Hi, I created the code below for uploading anywhere from 1-15 PDF files at once. Originally I was hitting 8M limit and (as per my research) I asked my server admin to expand the post_max_size to 100M. Now he did and I verified it, but somehow now I can not upload more than cca 2MB files. What could be causing that? Thanks $forms = array("form_1", "form_1A", "form_1B", "research_plan", "abstract", "form_1C", "form_2", "form_3", "form_4", "human_consent", "form_5A", "form_5B", "form_6A", "form_6B", "form_7"); foreach ($forms as $form_name) { if ($_FILES[$form_name]['name'] != "") { $allowed_filetypes = array('.pdf','.PDF'); $max_filesize = 104857600; $upload_path = 'upload/'; $extension = substr($_FILES[$form_name]['name'], strpos($_FILES[$form_name]['name'],'.'), strlen($_FILES[$form_name]['name'])-1); $filesize = filesize($_FILES[$form_name]['tmp_name']); $filesize_MB = $filesize / 1048576; $full_name = $_FILES[$form_name]['name']; $filename = "$_REQUEST[project_no] - $form_name$extension"; if (!in_array($extension,$allowed_filetypes)) {$error_1 = "yes";} if (filesize($_FILES[$form_name]['tmp_name']) > $max_filesize) {$error_2 = "yes";} if ($error_1 == "yes") { echo "One or more of the uploaded froms are not in allowed file format. Please upload only <strong>.pdf</strong> files <br/><br/><INPUT TYPE='button' VALUE='Go Back' onClick='history.go(-1);'>"; die (); } if ($error_2 == "yes") { echo "Maximum upload file size of <strong>100MB</strong> has been reached. <br/><br/><INPUT TYPE='button' VALUE='Go Back' onClick='history.go(-1);'>"; die (); } move_uploaded_file($_FILES[$form_name]['tmp_name'],$upload_path . $filename); mysql_query("UPDATE project_registrations SET $form_name = 'yes' WHERE project_no = '$_REQUEST[project_no]'"); } } echo "ISEF files for project number <strong>$_REQUEST[project_no]</strong> have been successfully uploaded."; mysql_query("UPDATE project_registrations SET isef_forms = 'yes' WHERE project_no = '$_REQUEST[project_no]'"); require ("upload_forms_email.php"); echo "<script language='javascript'> window.location.href='search_results.php?project_no=$_REQUEST[project_no]';</script>"; Quote Link to comment https://forums.phpfreaks.com/topic/254562-post_max_size-expanded-from-8m-to-100m-but-i-can-not-upload-larger-than-cca2m/ Share on other sites More sharing options...
kicken Posted January 7, 2012 Share Posted January 7, 2012 File uploads are also limited by the following directives: upload_max_filesize max_file_uploads Check those values as well. Quote Link to comment https://forums.phpfreaks.com/topic/254562-post_max_size-expanded-from-8m-to-100m-but-i-can-not-upload-larger-than-cca2m/#findComment-1305383 Share on other sites More sharing options...
pioneerx01 Posted January 7, 2012 Author Share Posted January 7, 2012 Oh I see. I have: upload_max_filesize = 2M max_file_uploads = 20 So I guess I should have upload_max_filesize increased to 100M as well? Anything else I should look into while I am emailing my admin? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/254562-post_max_size-expanded-from-8m-to-100m-but-i-can-not-upload-larger-than-cca2m/#findComment-1305386 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.