Forums

Not getting an error when file exceeds maximum upload size

ccfcu 25 Jan, 2017
I am not getting an error when upload files that are too large on a 3 page form. The form is submitting normally but larger files are not being uploaded like smaller files. I have tried using both "Event Loop" and "Display Message" on fail with no avail. (nice rhyme huh?)

In Chronoforms:
Max file size = 2000

In Joomla system information:
upload_max_filesize = 2M
post_max_size = 8M

Any ideas? The debugger is showing no errors.

Attached is a screenshot of my setup view.
GreyHead 25 Jan, 2017
Hi ccfcu,

Your screenshot didn't make it. please check Upload before Submit.

You can add a Custom Code action in the form On Submit event with some debugger code like this to see what has been uploaded by PHP
<?php
echo'<div>$_FILES: '.print_r($_FILES, true).'</div>';
?>
When you test check for any $_FILES entries with an Error Code

Bob

Bob
ccfcu 25 Jan, 2017
Hey Bob,

Thanks for the quick response. I went ahead and added that custom code and the result was:

$_FILES: Array ( [attachment1] => Array ( [name] => image-large.JPG [type] => [tmp_name] => [error] => 1 [size] => 0 ) [attachment2] => Array ( [name] => image-small.jpg [type] => image/jpeg [tmp_name] => /tmp/phpfkyBPX [error] => 0 [size] => 52054 ) )
ccfcu 27 Jan, 2017
Hey Bob,

Some more information on this:

1) Any uploaded larger than 2mb is not generating an error, even if I set the max limit in chronoform file upload to 2mb
2) I do receive an error if I change the chronoform file upload max to 1mb and try to upload a 1.5mb file
3) The custom code you gave me does not show anything when 2 large files are uploaded, $_FILES: Array ( )

Thanks for your help
GreyHead 29 Jan, 2017
Hi ccfcu,

If you check the $_FILES output you will see Error 1 for the first upload. The PHP docs say:
UPLOAD_ERR_INI_SIZE
Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
So you need to update the site php settings to increase the upload_max_filesize if you want ChronoForms to report on it. If PHP hasn't uploaded the file then it can't see it to do anything.

Bob
This topic is locked and no more replies can be posted.