File input and Dart

前端 未结 5 594
余生分开走
余生分开走 2020-12-11 03:14

I\'m trying out Dart, but I cant figure out, how to send an image from the user to the server. I have my input-tag, and i can reach this in the DART code, but i cant seem to

5条回答
  •  长情又很酷
    2020-12-11 03:56

    It's not necessary (any more) to use dart:dom FileReader instead of the one from dart:html.

    Your code should work if you add an event listener to the file reader, like this:

    FileReader fr = new FileReader();
    fr.on.load.add((fe) => doSomethingToString(fe.target.result));
    fr.readAsBinaryString(myFile);
    

提交回复
热议问题