I can't upload image to strapi

I am trying to upload image to strapi, but i am getting error 400 ,this my code :
I guess the error because it can’t read the file input i am not sure 🤔


    import axios from "axios";
    // const files = document.getElementById('file');
    let formData = new FormData();
    var file = document.querySelector('form');
      let handleUpload = () => {
   // You should have a server side REST API 
            headers: {
              'Content-Type': 'multipart/form-data'
        ).then(function () {
        .catch(function () {


<div class="card" >
    <form id="myFrom" >
      <br />
      <button type="submit"on:click={handleUpload()}>Send</button>

this there showing in my browser

116 thoughts on “I can't upload image to strapi”

  1. Hi I am so excited I found your webpage, I really found you by mistake, while I was researching on Bing for something else,
    Anyways I am here now and would just like to say
    many thanks for a incredible post and a all round interesting blog (I also love the
    theme/design), I don’t have time to go through it
    all at the moment but I have saved it and also added your RSS feeds, so when I have time I
    will be back to read much more, Please do keep up the superb job. https://buszcentrum.com/clomid.htm