PHP - Temp File Path is null
<p>I have a script that handles file uploads. I have uploaded files that are under 1 MB, but when the file is over 1 MB the script seems set the temporary file path to null. Here is the script below:</p>

<pre><code>$total = count($_FILES['DocName']['tmp_name']);
    for($i = 0; $i &lt; $total; $i++) {

        // Get the temp file path
        $tmpFilePath = $_FILES['DocName']['tmp_name'][$i];

        // Check if we have a path
        if ($tmpFilePath != "") {

            // Variables from form
            $FolderName = $_POST['FolderName'];
            $FolderName = stripslashes($FolderName);
            $FolderName = mysql_real_escape_string($FolderName);

            //Setup our new file path

            // Check if folder name is home, if so, set the file path to that folder
            if ($FolderName == "Home") {
                $target_dir = "../../cdn.brmbc.com/usercontent/".$UserID."/";
            }

            // If the folder name is not home, make the file go to that folder
            else {
                $IsInFolder = 1;
                $target_dir = "../../cdn.brmbc.com/usercontent/".$UserID."/".$FolderName."/";
            }

            $target_file = $target_dir . basename($_FILES["DocName"]["name"][$i]);
            $FileType = pathinfo($target_file,PATHINFO_EXTENSION);
            $DocumentName = $_FILES["DocName"]["name"][$i];

            echo $tmpFilePath . "&lt;br&gt;";
            echo $target_file . "&lt;br&gt;";
            echo $FileType . "&lt;br&gt;";
            echo $DocumentName . "&lt;br&gt;";
        }

        // Go home if there is no temp path
        else {
            echo $tmpFilePath . "&lt;br&gt;" . "Failed to upload";
        }
    }
</code></pre>

<p>Does there appear to be anything incorrect about the code, or is this just a server issue?</p>