• Hi,

    CF7 doesn’t appear to catch the 413 error which causes the form to be unusable. I can see it’s stuck in submitting with spinner spinning endlessly:
    <form class="wpcf7-form submitting"..

    For example if your form upload limit is 10mb and you attempt to upload a 20mb file, you will see NGINX server return the 413 error which is fine but CF7 breaks, no friendly response even though cf7 has a message for upload size too large.

    I use to have some custom code to catch this when cf7 use to use ajax, but it’s now using fetch so I don’t think this would work:

    $(document).ajaxError(function (e, xhr, opt) {
    				if ($("#supportForm").hasClass("wpcf7-form")) {
    					if (xhr.status === 413) {
    						setTimeout(function () {
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Lukasz

    (@wpfed)

    I tried on another site with the latest version of WP and cf7 but same issue of form breaking when file size is larger then allowed on server. Above ajaxError method does not work since CF7 now uses fetch API.

    This is definitely a bug. I still have not found a way to intercept the 413 error.

    Thread Starter Lukasz

    (@wpfed)

    I ended up increasing the max file/post size in php and NGINX (client_max_body_size). That was the only way around it to increase limit significantly higher so less chance of running into the 413 error.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Form breaks if upload is too big (error:413 Request Entity Too Large)’ is closed to new replies.