contao/core — Issue #3828: file upload fails with no error message or other notification when post_max_size is not large enough
Author: tibirna
Created: 2012-01-19 13:44:48+00:00
State: open

Uploading files in contao file manager is subject to three different parameters limiting the same variable: the maximum size of the uploaded file:
- the maxFileSize in contao/system/config/localconfig.php
- the upload_max_filesize in ${OSCONFIGDIR}/php.ini
- the post_max_size in ${OSCONFIGDIR}/php.ini

(also, PHPs manual speaks of another parameter, memory_limit, but I didn't yet encounter situations where this one is limiting)

In case the file I attempt to upload is larger in size than one of the first two variables, the same message error appears, informing of the current size limit. This is already confusing, because, upon seeing the message for a first time and modifying the first parameter, the second parameter still can block the upload, which brings up the exact same message (or perhaps with a different size limit indicated) but with no particular notification that now the second parameter is the cause. This confuses the user and puts undue blame on contao: it can then be accused of a false bug i.e. that changing the first parameter seems to not have any effect.

But the main reason of this message is that, even after digging internet and finding that the second parameter has to be fixed, then the third parameter could kick in and _still_ deny uploading of a reasonably large file. In this case unfortunately contao fails **silently** to complete the requested upload. No hint is even given that the upload didn't succeed. This is very confusing for the user and is even harder to debug, as internet contains very little information on this.