I'm creating a PHP script for uploading .PDF documents as medium BLOBs right into a MySQL database via PHP. The script also enables customers to find files and open/download them but I don't believe that area of the script is pertinent to my problem. The script works fine with files under 2 Megabytes but the moment I attempt and upload personal files that's a lot more than 2 Megabytes there is nothing starting my content(Medium BLOB) column and there's no value for that mime type. I've already attempted growing the max_packet_size for that MySQL server to 4 Megabytes from the default worth of 1 Megabytes. I've also up-to-date php.ini towards the correct values, I believe. I set upload_max_size to 4MB, publish_max_size to 4 Megabytes, and memory_limit to 16 Megabytes. I've not really played around with using the max_input_time though since it is past due to a minute which appears like plenty thinking about this script is perfect for an interior application with an intranet.

I've also attempted to trap errors in the PDO object during my script with errorInfo() and errorCode() and both through 0s (no error).

This is actually the upload portion of my script:

if ($key == 'upload')
{
	set_time_limit(0);
	$_SESSION['upload'] = $value;

	if ($_FILES['userfile']['name'])
	{
		$fileName = $_FILES['userfile']['name'];
		$tmpName  = $_FILES['userfile']['tmp_name'];
		$fileSize = $_FILES['userfile']['size'];
		$fileType = $_FILES['userfile']['type'];
		$docType = $_POST['docType'];
		$netKey = $_POST['netKey'];
		$fp       = fopen($tmpName, 'r');
		$content  = fread($fp, filesize($tmpName));
		$content  = addslashes($content);
        fclose($fp);

        $_SESSION['filetype'] = $fileType;

		if(!get_magic_quotes_gpc())
		{
    		$fileName = addslashes($fileName);
		}
		$sqlCheck = "SELECT id, name, documentType, networkKey FROM upload WHERE active='1'";
		foreach ($dbh->query($sqlCheck) as $row)
		{
			if (($row['name'] == $fileName) && ($row[networkKey] == $netKey) && ($row['documentType'] == $docType)) 
			{
				$_SESSION['updateRow'] = $row['id'];
			}

		}

		if ($_SESSION['updateRow'])
			{
				$deactivateDuplicate = "UPDATE upload SET active = 0, modifiedBy = '".strtoupper($_SERVER['REMOTE_USER'])."', modifiedDate = Now() WHERE id = '".$_SESSION['updateRow']."' AND active ='1'";
				$dbh->query($deactivateDuplicate);
				$_SESSION['sql'] = "SELECT id, name, documentType, type, size, networkKey, modifiedBy, modifiedDate, active FROM upload WHERE active = '1'";
				$_SESSION['uploadSearch'] =	1;
				$_SESSION['updateRow'] = 0;
			}
			$values = "'".$fileName."','".$docType."','".$fileType."','".$content."','".$fileSize."','".$netKey."','".strtoupper($_SERVER['REMOTE_USER'])."', Now(), 1";
			$sqlUpload = "INSERT INTO upload (name, documentType, type, content, size, networkKey, modifiedBy, modifiedDate, active) VALUES (".$values.")";
			$dbh->query($sqlUpload);

			$_SESSION['sql'] = "SELECT id, name, documentType, type, size, networkKey, modifiedBy, modifiedDate, active FROM upload WHERE active = '1'";
			$_SESSION['uploadSearch'] =	1;


	}
}

Here is the front-end from the application showing that the more compact file works along with a bigger file doesn't. The file sample.pdf is under 1 Megabytes and also the file test.pdf is 2.5 Megabytes.

http://www.imagechicken.com/viewpic.php?p=1255628359017775300&x=png

I'd used img tags but alas I'm a new user and never permitted.

The following factor I will search for is really a establishing Apache that limits file dimensions. I'm a new comer to Light so any tips could be great. Thanks

You may be accumulating from the restrictions from the HTTP request (that we think is 4MB), or perhaps your HTTP request may be timming out. I've encounter this problem before. You might like to look @ your php.ini apply for maximum upload size.

Disclaimer: I'm not a PHP developer :D