Created
June 23, 2019 01:07
-
-
Save drexel-ue/df1c37ff153905b291fcf8775ca23b38 to your computer and use it in GitHub Desktop.
This file contains 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
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