|
Post by ddcpitt on Oct 15, 2012 19:10:29 GMT -5
My program is working most of the time. It's echoing the correct error message when I try to upload a file that's 5MB (which is greater than the allowed 250k), but when I try to upload a file significantly over 250k, such as 20MB, the page just refreshes.
According to a user on the PHP manual page for move_uploaded_file, "If you try to upload a file larger than the post_max_size value (or multi files), the page will only refresh itself and no errors are thrown. It took me a while to figure the reason out."
I am just not sure why my program displays the error messages for files over 250k up to about 8MB, but for files over 8MB, the page just refreshes. Any help would be greatly appreciated!
|
|
|
Post by Bob P on Oct 15, 2012 19:34:34 GMT -5
Actually, this is a complicated area. There are settings in php scripts such as hidden fields, settings in the php.ini file, settings in the .htaccess file and settings in the conf file that may affect the limit on file size uploads. There is a function called ini_get (setting) that tries to obtain the php.ini value for a particular setting - see php manual for more info.
I ran it on the paradox server and the post max setting is 8 MB - may explain your situation.
echo 'post_max_size = ' . ini_get('post_max_size'); Bob
|
|
|
Post by ddcpitt on Oct 15, 2012 20:01:54 GMT -5
Well that would explain a lot. So I suppose this means our file upload programs are not expected to work for files larger than 8MB and we will not lose points when they don't? Thanks for your help!
|
|
|
Post by Bob P on Oct 15, 2012 20:12:02 GMT -5
One of the requirements of the homework is to limit users from trying to upload large files. Most systems will have this caution. Specifically, HW6 limited files to 250k
"Only allow files of reasonable size < 250k"
So, no penalty as long as you show some methodology to limit uploads.
Bob
|
|