1

EE 2.8.1, non-required file fields when trying to publish a channel entry all trigger the below error if they are left empty.

The uploaded file exceeds the maximum allowed size in your PHP configuration file.

Has anyone else come across this or had a fix? I haven't found anything but my Google-fu could be weak.

1

This was due to me having the php post_max_size set to -1 (unlimited) on my local machine.

The file manager should probably handle this, but it doesn't so I've amended Filemanager.php to the below, which fixes it:

public function validate_post_data()
{
    ee()->load->helper('number_helper');
    $post_limit = get_bytes(ini_get('post_max_size'));

    # If the post limit is -1 (i.e. unlimited) return true as we 
    # can't exceed the upload size
    if ($post_limit == -1) {
        return true;
    }

    return $_SERVER['CONTENT_LENGTH'] <= $post_limit;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.