title: Upload Image/File to Strapi (Flutter Web)
body: <p>I'm trying to upload an image to Strapi through Flutter Web. I'm aware (from this <a href="https://strapi.io/documentation/v3.x/plugins/upload.html#upload-files" rel="noreferrer">link</a>) that I need to use FormData to do so.  I've researched on many ways to do this and I stumble across <a href="https://pub.dev/packages/dio" rel="noreferrer">Dio</a> and of course <a href="https://pub.dev/packages/http" rel="noreferrer">Http</a>.</p>
  <p>Both solutions gave me errors:
  <code>Unsupported operation: MultipartFile is only supported where dart:io is available.</code></p>
  <p>I've tried this code:</p>
  <pre class="lang-dart prettyprint-override"><code>var request = new http.MultipartRequest(&quot;POST&quot;, Uri.parse(url));
      request.files.add(
        await http.MultipartFile.fromPath(
          &quot;files&quot;,
          imageFilePath,
        ),
      );
      request.send().then((response) {
        if (response.statusCode == 200) print(&quot;Uploaded!&quot;);
        print(response.statusCode);
      }).catchError((e) =&gt; print(e));
  </code></pre>
  <p>As suggested <a href="https://stackoverflow.com/a/60483780/9241842">here</a>.</p>
  <p>And many other getting errors or Empty Data (400), when I use <code>MultipartFile.fromBytes(...)</code>.</p>
  <p>I'm just trying to upload a file, therefore I assume my body should only contain the FormData with as <code>files</code> as it's mentioned on <a href="https://strapi.io/documentation/v3.x/plugins/upload.html#upload-files" rel="noreferrer">Strapi's Documentation</a>.</p>