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

The debug is interrupted, when the web upload 2G file reaches 55%. #40

Open
zxl777 opened this issue Apr 5, 2022 · 0 comments
Open

Comments

@zxl777
Copy link

zxl777 commented Apr 5, 2022

Tested 60MB file upload and it works fine.
Test 2G file upload, UI freezes, wait for a few minutes, Debug suddenly interrupts, see the screenshot.

image

<closure> (/Users/will/development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/browser_client.dart:56)
<asynchronous gap> (Unknown Source:0)
send (/Users/will/development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/browser_client.dart:54)
<asynchronous gap> (Unknown Source:0)
<closure> (/Users/will/development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/browser_client.dart:56)
<asynchronous gap> (Unknown Source:0)
send (/Users/will/development/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.4/lib/src/browser_client.dart:54)
<asynchronous gap> (Unknown Source:0)
addPickedFile (/Users/will/Downloads/flutter_file_picker-master/lib/_internal/file_picker_web.dart:98)
<closure> (/Users/will/Downloads/flutter_file_picker-master/lib/_internal/file_picker_web.dart:119)
<asynchronous gap> (Unknown Source:0)
changeEventListener (/Users/will/Downloads/flutter_file_picker-master/lib/_internal/file_picker_web.dart:121)
  void _pickFiles() async {
    _resetState();
    try {
      _directoryPath = null;
      _paths = (await FilePicker.platform.pickFiles(
        type: _pickingType,
        allowMultiple: _multiPick,
        onFileLoading: (FilePickerStatus status) => print(status),
        allowedExtensions: (_extension?.isNotEmpty ?? false)
            ? _extension?.replaceAll(' ', '').split(',')
            : null,
      ))
          ?.files;
    } on PlatformException catch (e) {
      _logException('Unsupported operation' + e.toString());
    } catch (e) {
      _logException(e.toString());
    }

    // final file = _paths?.single;
    // print(file);
    final minio = Minio(
      endPoint: 'xxx',
      accessKey: 'xxx,
      secretKey: 'xxx',
      useSSL: true,
      // enableTrace: true,
    );

    for (var file in _paths!) {
      await minio.putObject("snowball", file.name, Stream.value(file.bytes!),
          onProgress: (bytes) {
        print('[${file.name}] ${(bytes / file.size) * 100}% uploaded');
        title = '${(bytes / file.size) * 100}%';
        setState(() {});
      });
    }
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

1 participant