3

I have the following form:

<form method="post" action="./action.php?a=create" enctype="multipart/form-data">
    <input name="formType" type="hidden" value="file" required />
    <input name="formParent" type="hidden" value="<?php echo $parentID; ?>" required />
    <table class="fixed">
        <tr>
            <td>
                <p>Display Name</p>
            </td>
            <td>
                <input name="formName" type="text" placeholder="Enter File Name" autofocus autocomplete="off" required />
            </td>
        </tr>
        <tr>
            <td>
                <p>Select a File</p>
            </td>
            <td>
                <input name="formFile" type="file" placeholder="Select a File" required />
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <button class="confirm btn-warning" type="submit">Submit</button>
            </td>
        </tr>
    </table>
</form>

When I attempt to upload a file to my server, say less than 20MB, it works perfectly fine. But when I attempt to upload a larger file, say 1GB, that my $_POST data isn't set.

How can I tell my post data isn't set? When going to the action page using this form, it checks to see what formType is set to and displays/runs accordingly. But when I attempt to upload a larger file, it says that $_POST['formType'] isn't set, although looking at the form - it clearly is.

My Current PHP.ini config has the following different settings: upload_max_filesize = 5000M and post_max_size = 5000M

And I have a web.config file which states:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483648" />
      </requestFiltering>
    </security>
        <staticContent>
            <mimeMap fileExtension=".zipx" mimeType="application/x-zipx-compressed" />
        </staticContent>
  </system.webServer>
    <system.web>
        <sessionState timeout="60" />
    </system.web>
</configuration>

Why might it lose $_POST data after a certain amount of time, waiting for a file to upload? Is it possible to change a form upload timeout?

EDIT:

print_r($_POST) returns Array ( )

FileParts
  • 71
  • 6
  • _I am still looking for an answer, doesn't seem to be a well documented topic..._ – FileParts Jul 23 '15 at 08:16
  • While there is no upload timeout to my knowledge - there is an overall timeout in php.ini . Is it worthwhile to increase the timeout for the `sessionState` in the web.config file? – Adam T Aug 05 '15 at 16:38
  • I would also try print_r($_REQUEST) and you should then see all vars POSTed to action.php. One more thing, it may help (for testing anyway) to turn on error reporting for all PHP Errors using `error_reporting(-1);` – Adam T Aug 05 '15 at 17:02
  • Found this (link mention similar symptom but w/apache) - suggests restarting server after making change. http://www.linuxquestions.org/questions/linux-software-2/large-file-upload-%24_post-empty-in-php-281032/ – Adam T Aug 05 '15 at 17:20
  • Lastly, you should be able to do the following `echo "
    FILES: "; print_r($_FILES);`
    – Adam T Aug 05 '15 at 17:23
  • http://stackoverflow.com/questions/27263698/issues-transfering-data-between-php-pages-with-post?rq=1 and check answer from @shaunakde Mentions for IIS changing `maxAllowedContentLength` and provides a link with more detail. – Adam T Aug 05 '15 at 17:26

1 Answers1

0

Suggesting taking the code, and moving it to a Virtual Machine.

If you put the files, do configuration for a LAMP stack w/Apache - does it work as expected?

Testing on Apache can help you verify that your PHP code is fine.

Also, from comments, please visit http://www.linuxquestions.org/questions/linux-software-2/large-file-upload-%24_post-empty-in-php-281032/ and Issues transfering data between PHP pages with POST perhaps they will help you in this.

Community
  • 1
  • 1
Adam T
  • 675
  • 8
  • 22