$ _POST variables are not saved when loading a large file

Firstly, I know that similar questions have been asked, but my file size is not limited to files on the server ....

When using one page with the form below and trying to send it to another file containing a script, it works fine with small files (up to 2 MB). However, a slightly larger file (about 3 MB) seems to pass $ _POST variables correctly, but the script does not work for an unknown reason. Finally, a test file from 9MB cannot send $ _POST variables at all, and print_r($_POST) shows each as undefined.

Here is the form:

 <form enctype="multipart/form-data" id="formEditTAPPS" method="POST" action="scripts/editTAPPSprocess.php"> Page ID Number: <? echo $id; ?> <input type="hidden" name="id" value="<? echo $id; ?>" /> <br /> Page Title: <input type="text" name="newPageTitle" value="<?php echo $row['title']; ?>" style="width:300px;" /> <br /> Number of Pages in PDF: <input type="text" name="newNumberOfPages" value="<?php echo $row['num_pages']; ?>" style="width:30px;" /> <br /> TAPPS Category: <select name="newCategory"> <? while ($row2 = mysql_fetch_array($data2)) { $catIDfromCat = $row2['cat_id']; $catName = $row2['cat_name']; ?><option value="<? echo $catIDfromCat; ?>" <?php if ($catIDfromPages==$catIDfromCat){echo "selected=\"selected\"";} ?> ><? echo $catName; ?></option> <? } ?> </select> <br /> Last Updated: <? echo $row['last_updated']; ?> <br /> Display Order: <input type="text" name="newDisplayOrder" value="<?php echo $row['display_order']; ?>" /> <br /> Existing PDF: <a href="/files/tapps/<? echo $row['filename']; ?>" /><? echo $row['filename']; ?></a> <br /> Upload a New PDF: <input name="newPDF" type="file" /> <br /> <input type="submit" name="Submit" value="Update this TAPPS Page" style="margin: 20px 0 0 50px;" /> 

And here is the processing script:

 include_once('../../../common/db/conn.php'); // Connect to the database // Assigns the variables passed from the form. $id = $_POST['id']; $title = $_POST['newPageTitle']; $num_pages = $_POST['newNumberOfPages']; $cat_id = $_POST['newCategory']; $display_order = $_POST['newDisplayOrder']; $newPDF = basename($_FILES['newPDF']['name']); // Try to upload the file... $target = "../../../files/tapps/"; $target = $target . $newPDF; if(move_uploaded_file($_FILES['newPDF']['tmp_name'], $target)) { // Saves the data into the correct database table. $sql = "UPDATE tapps_pages SET title='$title', num_pages='$num_pages', cat_id='$cat_id', display_order='$display_order', filename='$newPDF' WHERE id='$id'"; // Verifies the database stores the form results and sends the user to the "Success" page. $result = mysql_query($sql); if($result) { echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=../editTAPPSpage.php?id=$id&success=1\">"; } else { echo "<br /><br />Bummer, something broke. &nbsp;&nbsp;&nbsp;&nbsp; =(<br /><br />"; print_r($_POST); } } else { // Problem uploading the file echo "<br /><br />Looks like there was a problem uploading the TAPPS page... Better tell Kevin!<br /><br />He going to want to know this info, so please copy and paste it into the email...<br />"; print_r($_POST); echo "<br /><br />"; print_r($_SERVER); echo "<br /><br />"; print_r($_SESSION); } 

Sounds like upload_max_filesize problem for me, but I turned to it with the php.ini file:

 memory_limit = 128M max_execution_time = 600 upload_max_filesize = 50M post_max_size = 64M 

And phpinfo() shows that the change got stuck after rebooting Apache.

Am I missing a parameter that can cause a timeout or limit the file size to 2 MB? Thanks in advance for your help!

+4
source share

All Articles