Thanks for the suggestions.
I did change the memory limit in php.ini from 8MB to 16MB, and that stopped the "This document contains no data" firefox error I was getting. Now, the file seems to upload but chokes, I think, on this part of the script:
$content = fread($fp, filesize($tmpName)); // line 34
$content = addslashes($content); // line 35
So uploading a file larger than 8MB now produces the following error:
Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 18329807 bytes) in /var/www/livesite/fileshare/file_process.php on line 35
In my version of PHP -- 4.1.2 -- the memory_limit value that sets how much memory the processing of a script can consume can't be higher than 24MB. Mine is set to 24M...thus the "allowed memory size of 25165824 in the error message above.
So now I have two questions. The first is: why is the server reaching the allowed memory size of 24M when it is only trying to allocate roughly 18M? Is this a sign of a "memory leak" in the code?
The second is: why does the server need to allocate 18M when the file being uploaded is, in this case, only 8.25M in size?
Note also that the error message says it is choking at line 35 of the script: $content = addslashes($content). Am I right in thinking that the more than doubling in size of the allocated memory happens because the data in $content is being read in effect twice (i.e., the second time through the addslashes() command?
If I comment that line out, it will upload the large file to the server and doesn't choke...but it can't add the file to the database anymore either using this bit of script:
// INSERT INTO STORED TABLE
$query = "INSERT INTO fs_stored (s_thefile, s_thetype) VALUES ('$content', '$file_type')";
if(mysql_query($query)) // ....
If this is the case, that it is reading the file twice, then I think I am sunk because the script will consume twice the amount of memory than I can allocate to it.
Any ideas?