title: Format to POST a file to the ImageKit server?
body: <p>I've successfully built a React UI to select and upload N files.  The key part of it is this:</p>
  <pre><code>&lt;input type='file' accept='image/*' id='selectFiles' multiple onChange={handleFileChange} /&gt;
  </code></pre>
  <p>The selected files are stored in this state variable:</p>
  <pre><code>const [fileList, setFileList] = React.useState&lt;FileList&gt;();
  </code></pre>
  <p>I know they're correctly there because I iterate through them and show them in a preview DIV.</p>
  <p>Following ImageKit's instructions, I successfully built an Auth endpoint which returns the auth credentials.</p>
  <p>Then, within a <code>useEffect</code> I iterated through <code>fileList</code> to upload one photo at a time to the ImageKit server.  But even trying just one file, I keep getting a 400 error informing me that the <code>fileName</code> parameter is missing.  It definitely is not missing so I suspect that the problem lies with what I'm providing as the <code>file</code> parameter.</p>
  <p>Here's the critical code (with some data obscured for privacy reasons) :</p>
  <pre><code>    const uploadFile = async (file: File) =&gt; {
        try {
          const body = {
            file: file,
            publicKey: 'my_public_key',
            signature: 'imageKit_signature',
            expire: 'imageKit_expiry_value',
            token: 'imageKit_token',
            fileName: 'test123.jpg',
            useUniqueFileName: false,
            folder: userName,
            overwriteFile: false,
          };
  
          const response = await axios.post('https://upload.imagekit.io/api/v1/files/upload', body);
          console.log(response.status, response.data);
        } catch (err) {
          console.error(err);
        }
      };
  </code></pre>
  <p>Might anyone see what I'm doing wrong?</p>
  <p>Robert</p>