title: Flutter web upload file
body: <p>I want to upload files using Flutter web, but I encountered some problems, my steps are as follows:</p>
  
  <pre class="lang-dart prettyprint-override"><code>/// choose file
    void _chooseFile() {
      InputElement uploadInput = FileUploadInputElement();
      uploadInput.accept = ".mp4";
      uploadInput.multiple = true;
      uploadInput.click();
      uploadInput.onChange.listen((event) {
        final files = uploadInput.files;
        if (files.length == 1) {
          final file = files[0];
          final reader = FileReader();
          reader.onLoadEnd.listen((event) {
            print('loaded: ${file.name}');
            print('type: ${reader.result.runtimeType}');
            print('file size = ${file.size}');
            _uploadFile(file);
          });
          reader.onError.listen((event) {
            print(event);
          });
          reader.readAsArrayBuffer(file);
        }
      });
    }
  
  /// upload file
  /// file: in dart:html package not in dart:io package
    void _uploadFile(File file) async {
      FormData data = FormData.fromMap({
        'file': MultipartFile.fromBytes(
          List&lt;int&gt;, // -----------------------------&gt; problem line
          filename: file.name,
        )
      });
      Dio dio = new Dio();
      dio.post('upload file url', data: data, onSendProgress: (count, total) {
        print('$count ==&gt; $total');
      }).then((value) {
        print('$value');
      }).catchError((error) =&gt; print('$error'));
    }
  
  </code></pre>
  
  <p>The problem is that  <code>MultipartFile.fromBytes(List&lt;int&gt; value, {...})</code>, but I don't know how to conver <code>file</code> <strong>( in dart:html not in dart:io )</strong> to <code>List&lt;int&gt;</code>.</p>
  
  <p>Thanks!!!</p>