google / google/googleapis.dart
discoveryapi_commons: Help for working with video file for uploading in Stream
- Dominant language
- Dart
- Stars
- 419
- Forks
- 136
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 5
Description
I am working with Youtube API. For Uploading a video we need to convert a file into Inputstream .But iam getting error --| ApiRequestError(message: Invalid response for resumable upload attempt (status was: 500))|--
Kindly help me out to resolve this.
My code is as follows
File postFile = new File(filePath);
Stream> inputStream = new File(filePath).openRead();
inputStream
.transform(utf8.decoder)
.listen((String line) {
print('|---$line: ${line.length} bytes ---|');
},
onDone: () { print('File is now closed.'); },
onError: (e) { print('InputStream Error :${e.toString()}'); });
Media uploadMedia = new Media(inputStream,postFile.lengthSync());
-------
Thanks in Advance
Contributor guide
Assessment
This issue has not been assessed yet.