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

Web upload is restricted to 1GB #2357

Open
ManishKiranagi opened this issue Jan 21, 2025 · 0 comments
Open

Web upload is restricted to 1GB #2357

ManishKiranagi opened this issue Jan 21, 2025 · 0 comments
Labels
h: need triage This issue needs to be categorized s: bug Something isn't working

Comments

@ManishKiranagi
Copy link

Package

dio

Version

5.7.0

Operating-System

Web

Adapter

Default Dio

Output of flutter doctor -v

[!] Flutter (Channel unknown, 3.7.0, on Microsoft Windows [Version 10.0.19045.5371], locale en-GB)
    ! Flutter version 3.7.0 on channel unknown at C:\Dev\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision b06b8b2710 (2 years ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\ManishKiranagi\AppData\Local\Android\sdk
    • Platform android-34, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Users\ManishKiranagi\AppData\Local\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.96.3)
    • VS Code at C:\Users\ManishKiranagi\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.102.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.5371]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 131.0.6778.265
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 132.0.2957.115

[√] HTTP Host Availability
    • All required HTTP hosts are available

Dart Version

2.19.0

Steps to Reproduce

I am trying to upload over 1GB file on the Web using StreamList obtained from dropzone file getFileStream.

I can confirm this is working fine for file sizes equal to and less that 1 GB (1073741824)

 final response = await dio.put(
   filePath,
    data: fileStream,
    options: Options(
      headers: {
        'content-type': 'application/octet-stream',
      },
    ),
    onSendProgress: (count, total) {
      // print(count.toString() + '    ' + total.toString() + '  ' + (count / total).toStringAsFixed(2));
      if (onSendProgress != null) {
        onSendProgress(count, total);
      }
    },
  );

Expected Result

Entire file content should be uploaded

Actual Result

I am getting a series of RangeError: Array buffer allocation failed errors.
The file gets uploaded but is is truncated to 1073741824 (1GB).

Uncaught (in promise) RangeError: Array buffer allocation failed
at new ArrayBuffer ()
at new Uint8Array ()
at NativeUint8List._create1 (native_typed_data.dart:1069:7)
at NativeUint8List.new (native_typed_data.dart:1039:42)
at convert._ByteCallbackSink.new.add (byte_conversion.dart:86:19)
at _RootZone.runUnaryGuarded (zone.dart:1593:10)
at [_sendData] (stream_impl.dart:339:11)
at [_add] (stream_impl.dart:271:7)
at [_add] (stream_transformers.dart:63:11)
at _EventSinkWrapper.new.add (stream_transformers.dart:13:11)
at progress_stream.dart:35:15
at _HandlerEventSink.new.add (stream_transformers.dart:209:17)
at [_handleData] (stream_transformers.dart:111:24)
at _RootZone.runUnaryGuarded (zone.dart:1593:10)
at [_sendData] (stream_impl.dart:339:11)
at _DelayedData.new.perform (stream_impl.dart:515:13)
at _PendingEvents.new.handleNext (stream_impl.dart:620:10)
at async._AsyncCallbackEntry.new.callback (stream_impl.dart:591:7)
at Object._microtaskLoop (schedule_microtask.dart:40:11)
at _startMicrotaskLoop (schedule_microtask.dart:49:5)
at async_patch.dart:166:15

@ManishKiranagi ManishKiranagi added h: need triage This issue needs to be categorized s: bug Something isn't working labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
h: need triage This issue needs to be categorized s: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant