KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 read from it. Im trying something like: InputElement ie = document.query('#myinputelement'); ie.on.change.add((event){<br/> InputElement iee = document.query('#myinputelement');<br/> FileList mfl = iee.files;<br/> File myFile = mlf.item(0);<br/> FileReader fr = new FileReader(); fr.readAsBinaryString(myFile); String result = fr.result; //this is always empty }); With the html containing: <input type="file" id="myinputelement"> I really hope you cant help me, im kinda stuck. I might just be missing how to do the onload for the filereader, or maybe im doing it totally wrong.
Tags (comma-separated)
Save Edits
Cancel