Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatException #30

Open
naveenbharadwaj19 opened this issue Mar 1, 2022 · 14 comments
Open

FormatException #30

naveenbharadwaj19 opened this issue Mar 1, 2022 · 14 comments

Comments

@naveenbharadwaj19
Copy link

I have a Uint8List i want to create a filepath . 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 ?

@blackbeario
Copy link

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]()

@YouSour
Copy link

YouSour commented Apr 22, 2022

the same , any solution ?

@tanjunior
Copy link

Same here problem for me too.

@aquilarafa
Copy link

Same here. Any alternative to convert Uint8List to File on web?

@YouSour
Copy link

YouSour commented May 20, 2022

solved by this package if you want to convert File to Uint8list https://pub.dev/packages/image_picker

@aquilarafa
Copy link

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

@YouSour
Copy link

YouSour commented May 21, 2022

@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

@YouSour
Copy link

YouSour commented May 21, 2022

can i ask what are you guy doing ? why convert Uint8list to file ?

@aquilarafa
Copy link

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.

@YouSour
Copy link

YouSour commented May 21, 2022

@aquilarafa which package ?

@aquilarafa
Copy link

@aquilarafa which package ?

Sendbird flutter sdk

@YouSour
Copy link

YouSour commented May 22, 2022

@aquilarafa what's the end of your goal ?

@Bharathh-Raj
Copy link

Facing same issue

@triay0
Copy link

triay0 commented Dec 28, 2022

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants