Skip to content

🐛 Bug Report:Flutter web app, createFile() not uploading the whole file #81

@DobreRadu

Description

@DobreRadu

👟 Reproduction steps

I am using flutter_dropzone: ^3.0.5 to load the file,in onDrop: (dynamic ev) I added

  List<int> resultValue = [];
  await for (List<int> lista in controller.getFileStream(ev)) {
                                    resultValue = resultValue + lista;
                                  }

to create to create a List of the file.Using the createFile from appwrite sdk loads the image on the server(bigger than 5MB),it displays the actual size but when downloading it gives me part of the image(I estimate 5MB of data because of the test I did,where an image of 6Mb was not showing like 1/6 of the bottom part) and opening in New Window gives me a part of image then a link.

Future<File> result = storage.createFile(
                                    bucketId: '62fb5a75577eb6912acd',
                                    fileId: 'unique()',
                                    file: InputFile(
                                        filename: '${ev.name}',
                                        bytes: resultValue),
                                  );

Don't believe is from the flutter_dropzone,it works as it gives me the image as List,it actually loads all the bytes needed.
Flutter doctor output:

[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1889], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.5)
[√] Android Studio (version 2021.2)
[√] VS Code (version 1.70.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

👍 Expected behavior

The image should be fully displayed.

👎 Actual Behavior

Part of it is showing.

🎲 Appwrite version

Different version (specify in environment)

💻 Operating system

Flutter web

🧱 Your Environment

SDK is 6.0.0 and Server is v:0.15.3.402.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions