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

Can't Send large files through http multipart flutter web #854

Open
aliaafreen opened this issue Jan 19, 2023 · 6 comments
Open

Can't Send large files through http multipart flutter web #854

aliaafreen opened this issue Jan 19, 2023 · 6 comments
Labels
package:http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@aliaafreen
Copy link

When I am uploading a video of 500mb to the server, then it gives me error -
RangeError: Array buffer allocation failed
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart 1069:7 _create1
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/native_typed_data.dart 1039:42 new
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/convert/byte_conversion.dart 86:19 add
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1586:10 runUnaryGuarded
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_impl.dart 339:11 [_sendData]
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_impl.dart 515:13 perform
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_impl.dart 620:10 handleNext
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_impl.dart 591:7 callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15

and not uplaoding video on the server.

Is there any solution to upload large videos upto 4 gb to the server from flutter web?

flutter - 3.3.9
http- 0.13.5
file_picker-5.2.2

@aliaafreen aliaafreen added package:http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 19, 2023
@AlexV525
Copy link
Contributor

cc @brianquinlan

@brianquinlan
Copy link
Collaborator

Hi @aliaafreen,

Unfortunately the web implementation of Client does not support streaming request data.

If you are OK only supporting newer Chromium-based browsers then you could use package:fetch_client, which implements the Client interface.

@AlexV525
Copy link
Contributor

Is it about the streaming? The log says the memory buffer has failed to allocate.

@brianquinlan
Copy link
Collaborator

I'm assuming that this issue is being caused because the browser can't allocate enough memory to send the request so streaming the request would fix this.

@devoncarew
Copy link
Member

@brianquinlan - should we think about re-implementing the web client in terms of the https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API API? (see also #595)

@brianquinlan
Copy link
Collaborator

@devoncarew I think that package:fetch_client already does this and there is no reason for us to step in.

I could add stream as a feature in the HTTP implementation comparison table.

I didn't do that before because the answer is sometimes nuanced ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:http type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants