Discussion:
[dart-misc] Sending image through json with Dart
Mateusz Lewandowski
2016-10-12 08:38:14 UTC
Permalink
Hi, I am looking for method which allows me to send image through json.
When i try to convert File from inputy type=file, the encode json method
does not work on it.
What type it should be for Image to send it to web service through json.
Something like byte array?
Thanks in advance.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2016-10-12 09:16:07 UTC
Permalink
JSON does not have a byte array type, and while you could put integers
in an array, the wire format will be terrible. You either implement a
multipart upload[1] or stick with base64-encoded binaries[2]. Unless
you have a Google-scale traffic, I'd stick with base64, even mid-sized
companies are fine with it, especially if the transport layer has some
kind of compression on it.

[1] http://stackoverflow.com/a/28080392/333198
[2] http://stackoverflow.com/a/1443240/333198

Cheers,
Istvan


On Wed, Oct 12, 2016 at 10:38 AM, Mateusz Lewandowski
Post by Mateusz Lewandowski
Hi, I am looking for method which allows me to send image through json.
When i try to convert File from inputy type=file, the encode json method
does not work on it.
What type it should be for Image to send it to web service through json.
Something like byte array?
Thanks in advance.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...