Last month I asked our host to increase “upload_max_filesize” and “post_max_size” to 10MB. They updated the settings which I confirmed in phpinfo() but I continued to see this error:
So I played with .htaccess files for a while, and gave up for about a week till I had some extra time today to spend with Drupal.
After some serious searching I find “file upload size silently cut in half”.
drupal/inclues/file.inc
/**
* Determine the maximum file upload size by querying the PHP settings.
*
* @return
* A file size limit in bytes based on the PHP upload_max_filesize and post_max_size
*/
function file_upload_max_size() {
static $max_size = -1;
if ($max_size < 0) {
$upload_max = parse_size(ini_get(‘upload_max_filesize’));// sanity check- a single upload should not be more than 50% the size limit of the total post
$post_max = parse_size(ini_get(‘post_max_size’)) / 2;$max_size = ($upload_max < $post_max) ? $upload_max : $post_max;
}
return $max_size;
}
WHAT?! Remove the ” / 2″ and all is fixed.
Post a Comment