[Vuejs]-Why do I get this error (failed) net::ERR_CONNECTION_CLOSED after ajax request?

0👍

What I did is the following:

var verifyIdentity = formData.get('verify_identity')

if(verifyIdentity && verifyIdentity.size === 0){
    formData.delete('verify_identity')
}

Basically saying, if there is a file type attribute, but it is not filled out (meaning you never actually picked the file to submit), just remove it from form data.

It’s a tad different example as I don’t see what you’re actually submitting, but I noticed the issue on my part was due to the type="file" input fields.

Leave a comment