So I have an 9MB file that is uploaded. I'm going to store the content of the file in a mysql table.
I have the content in a variable. I run mysql_real_escape_string and I end up with the following error:
Fatal error: Allowed memory size of 26214400 bytes exhausted (tried to allocate 17842413 bytes) in upload.php on line 68
(line 68 being the mysql_real_escape_string)
Here is the stripped code:
$fp = fopen($tmpName, 'rb');
if (!$fp)
{
exit();
}
$content = fread($fp, filesize($tmpName));
fclose($fp);
$content = mysql_real_escape_string($content);
I tried using addslashes instead but it leads to the same error. I don't really get the error since I have more memory than the script is using. Please help, I spent more than 5 hours on this and I can not figure out what to do!