universal_io
universal_io copied to clipboard
FormatException
I have a Uint8List
i want to create a file
path . But i'm getting Error: FormatException: Invalid UTF-8 byte (at offset 0)
Uint8List unit8List;
uio.File createFileFromUint8List(Uint8List uint8list) => uio.File.fromRawPath(uint8list);
Can someone tell me how to resolve this ?
Same problem here.
Error: FormatException: Unexpected extension byte (at offset 0)
at Object.throw_ [as throw] ([http://localhost:59110/dart_sdk.js:5067:11]())
at convert._Utf8Decoder.new.convertGeneral ([http://localhost:59110/dart_sdk.js:50774:19]())
at convert._Utf8Decoder.new.convertSingle ([http://localhost:59110/dart_sdk.js:50751:19]())
at Utf8Decoder.convert ([http://localhost:59110/dart_sdk.js:50616:67]())
at Utf8Codec.decode ([http://localhost:59110/dart_sdk.js:50331:22]())
at Function.fromRawPath ([http://localhost:59110/packages/universal_io/src/io/sync_socket.dart.lib.js:3600:41]())
at createFileFromUint8List ([http://localhost:59110/packages/administrator/presentation/widgets/ad_template/ad_template_view.dart.lib.js:713:43]())
at ad_template_view._AdTemplateState.new.<anonymous> ([http://localhost:59110/packages/administrator/presentation/widgets/ad_template/ad_template_view.dart.lib.js:716:34]())
at Generator.next (<anonymous>)
at [http://localhost:59110/dart_sdk.js:40571:33]()
at _RootZone.runUnary ([http://localhost:59110/dart_sdk.js:40441:59]())
at _FutureListener.thenAwait.handleValue ([http://localhost:59110/dart_sdk.js:35363:29]())
at handleValueCallback ([http://localhost:59110/dart_sdk.js:35931:49]())
at Function._propagateToListeners ([http://localhost:59110/dart_sdk.js:35969:17]())
at async._AsyncCallbackEntry.new.callback ([http://localhost:59110/dart_sdk.js:35698:27]())
at Object._microtaskLoop ([http://localhost:59110/dart_sdk.js:40708:13]())
at _startMicrotaskLoop ([http://localhost:59110/dart_sdk.js:40714:13]())
at [http://localhost:59110/dart_sdk.js:36191:9]()
the same , any solution ?
Same here problem for me too.
Same here. Any alternative to convert Uint8List to File on web?
solved by this package if you want to convert File to Uint8list https://pub.dev/packages/image_picker
solved by this package if you want to convert File to Uint8list https://pub.dev/packages/image_picker
The issue is to convert Uint8List to web representation of File
@aquilarafa haha, i'm confused, my bad, i think you guy should check source code this package maybe it can help https://pub.dev/packages/file_saver
can i ask what are you guy doing ? why convert Uint8list to file ?
can i ask what are you guy doing ? why convert Uint8list to file ?
I'm using a package that expects a File (on web using universal_io package) but I only have the image Uint8list.
@aquilarafa which package ?
@aquilarafa which package ?
Sendbird flutter sdk
@aquilarafa what's the end of your goal ?
Facing same issue
Same here