Created
February 2, 2020 13:51
-
-
Save carzacc/4037d367611b995d505927c7fd16835b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(String filename, String url) async { | |
var request = http.MultipartRequest('POST', Uri.parse(url)); | |
request.files.add( | |
http.MultipartFile( | |
'picture', | |
File(filename).readAsBytes().asStream(), | |
File(filename).lengthSync(), | |
filename: filename.split("/").last | |
) | |
); | |
var res = await request.send(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment