Skip to content

Instantly share code, notes, and snippets.

@drexel-ue
Created June 23, 2019 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drexel-ue/df1c37ff153905b291fcf8775ca23b38 to your computer and use it in GitHub Desktop.
Save drexel-ue/df1c37ff153905b291fcf8775ca23b38 to your computer and use it in GitHub Desktop.
2019-06-22 20:53:31.622515
[SEVERE] aqueduct: GET /videoData/56 22285ms 500 {user-agent : Dart/2.3 (dart:io)\naccept-encoding : gzip\ncontent-length : 0\nhost : 10.0.2.2:8888\nauthorization : Bearer 8VlIFnNrPF0LbedAmE2pZA1Sc8RdjU8K\n} NoSuchMethodError: The getter 'length' was called on null.
Receiver: null
Tried calling: length
this is the offending code:
..route('/videoUpload')
.link(() => Authorizer.bearer(authServer))
.linkFunction((Request request) async {
final transformer = MimeMultipartTransformer(
request.raw.headers.contentType.parameters["boundary"]);
final parts = await transformer
.bind(Stream.fromIterable([await request.body.decode<List<int>>()]))
.toList();
parts.forEach((MimeMultipart part) {
part.listen((List<int> data) async {
await File(
'uploads/${request.raw.headers.value('userID')}_${request.raw.headers.value('startTime')}.mp4')
.writeAsBytes(data);
});
});
return Response.ok('cool');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment