We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
void _submitApplyGuider(BuildContext context, viewModel) async { var token = await Helpers.getSharedPrefs('token'); Map<String, String> headers = { "Authorization": "Bearer $token", "Content-Type": "multipart/form-data" }; var uri = Uri.parse(settings.baseUrl + "/update-introduce"); print(uri); var request = new http.MultipartRequest("POST", uri); // add header request.headers.addAll(headers);
request.fields['bio'] = "Test fields"
// var streamAudio = new http.ByteStream( // DelegatingStream.typed(_formData['audio_file'].openRead())); // var streamVideo = new http.ByteStream( // DelegatingStream.typed(_formData['movie_file'].openRead())); // var lengthAudio = await _formData['audio_file'].length(); // var lengthVideo = await _formData['movie_file'].length(); // // var multipartFile = new http.MultipartFile( // 'audio_file', streamAudio, lengthAudio, // filename: basename(_formData['audio_file'].path)); // var multipartFileVideo = new http.MultipartFile( // 'movie_file', streamVideo, lengthVideo, // filename: basename(_formData['movie_file'].path));
// request.files.add(multipartFile); // request.files.add(multipartFileVideo);
request.files.add(await http.MultipartFile.fromPath( 'audio_file', _formData['audio_file'].path)); request.files.add(await http.MultipartFile.fromPath( 'movie_file', _formData['movie_file'].path)); StreamedResponse response = await request.send().then((response) { print("successful"); print(response.toString()); if (response.statusCode == 200) Helpers.appDialog(context, "Update successfully !", 'success'); }); print(response.toString()); response.stream.transform(utf8.decoder).listen((value) { print(value); });
}
I don't know when I upload file It's the error.
The text was updated successfully, but these errors were encountered:
I think you should maybe paste the error message and stack trace, so it's easier to diagnose what's going on.
Sorry, something went wrong.
Closing since we'll be unable to help without more details.
No branches or pull requests
void _submitApplyGuider(BuildContext context, viewModel) async {
var token = await Helpers.getSharedPrefs('token');
Map<String, String> headers = {
"Authorization": "Bearer $token",
"Content-Type": "multipart/form-data"
};
var uri = Uri.parse(settings.baseUrl + "/update-introduce");
print(uri);
var request = new http.MultipartRequest("POST", uri);
// add header
request.headers.addAll(headers);
// var streamAudio = new http.ByteStream(
// DelegatingStream.typed(_formData['audio_file'].openRead()));
// var streamVideo = new http.ByteStream(
// DelegatingStream.typed(_formData['movie_file'].openRead()));
// var lengthAudio = await _formData['audio_file'].length();
// var lengthVideo = await _formData['movie_file'].length();
//
// var multipartFile = new http.MultipartFile(
// 'audio_file', streamAudio, lengthAudio,
// filename: basename(_formData['audio_file'].path));
// var multipartFileVideo = new http.MultipartFile(
// 'movie_file', streamVideo, lengthVideo,
// filename: basename(_formData['movie_file'].path));
// request.files.add(multipartFile);
// request.files.add(multipartFileVideo);
}
I don't know when I upload file It's the error.
The text was updated successfully, but these errors were encountered: