400 error on uploading a file (Axios Post)

Is that a valid SSL cert or a self-signed one? You may need to tell axios to ignore certificate errors

I even add the same issue. In my case, I was using Ngrok for exposing localhost:1337 to URL http://gfhjkddhf234re.ngrok.io (NON-SECURE). When I try to upload files I’m getting bad requests. I have changed my URL to HTTPS and then it worked. From here I noticed that either you can use the backend URL as http://localhost:1337 or use the HTTPS version of domains like https:// your domain .com

Hi friend,
you can try this
formData.append(‘files’,this.file,this.file.name)
console.log(formData);
await fetch(‘http://localhost:1337/api/upload’,{
method: “post”,
body: formData,
})