google / google/googleapis.dart

discoveryapi_commons: Help for working with video file for uploading in Stream

Open
#135 1 comment 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.