sdk-for-flutter icon indicating copy to clipboard operation
sdk-for-flutter copied to clipboard

🐛 Bug Report: File upload fails if file is greater than 5 MB i.e., needs multiple chunks

Open puntiz opened this issue 9 months ago • 10 comments

👟 Reproduction steps

I upload file smaller than 5 MB is its works no problem as soon as I try uploading file larger than that I run into below errors captured from network console and docker logs

This was different on Appwrite 1.6.0 with SDK 13.0.0 .. below the previous issue about this that was closed

https://github.com/appwrite/sdk-for-flutter/issues/225

The storage bucket has allows all users to be able to upload files, max file size is 300 mb, compression enabled with Gzip, encryption enabled and file security disabled

👍 Expected behavior

SDK should manage chunking and should upload the file

👎 Actual Behavior

Image Image

🎲 Appwrite version

Version 2.0.x

💻 Operating system

Linux

🧱 Your Environment

Appwrite self hosted 1.6.1 SDK 14.0.0

Same issue when tested with SDK 13.0.0

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

  • [x] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

puntiz avatar Feb 19 '25 21:02 puntiz

@puntiz Please provide the full context of your code so we can appropriately recreate this.

I tested this on a brand new gitpod instance running 1.6.1 and was able to upload files up to 300mb just fine using web w/ the following:

final file = await _storage.createFile(
        bucketId: _appConfig.bucketId,
        fileId: fileId,
        file: InputFile.fromBytes(
          bytes: bytes,
          filename: fileName,
        )

EVDOG4LIFE avatar May 02 '25 18:05 EVDOG4LIFE

@EVDOG4LIFE Not sure what additional context I can provide. Just updated to Flutter SDK 15.0.2 and now I get an ID already exists error.

The complete code snippet, which to me looks same as yours. Image

Error Image

What is looks like on Appwrite console. Image

puntiz avatar May 04 '25 20:05 puntiz

Hey @EVDOG4LIFE, were you able to reproduce this ?

puntiz avatar May 13 '25 13:05 puntiz

@puntiz hi there, we were not able to reproduce this issue on self-hosted as well. can you please try updating your version and see if that helps? https://appwrite.io/docs/advanced/self-hosting/update

ChiragAgg5k avatar May 21 '25 10:05 ChiragAgg5k

Waiting for upgrade path to 1.7.x to stabilise. Will upgrade and come back.

puntiz avatar May 23 '25 22:05 puntiz

@puntiz 1.7.4 should be pretty stable now. try giving it a shot now?

ChiragAgg5k avatar May 27 '25 07:05 ChiragAgg5k

@ChiragAgg5k upgraded today. Will test and come back in a day..

puntiz avatar May 28 '25 18:05 puntiz

@ChiragAgg5k sorry it took some time for me to get to this. Unfortunately it still get a totalChunk error. Screenshot of the docker logs from appwrite container below. The file I tried to upload was a mere 6 MB. So as mentioned before, any file that requires chunking doesnt work.

Image

puntiz avatar Jun 05 '25 16:06 puntiz

@ChiragAgg5k Just came across a post on Discord and it explains the issue. Apparently chunked uploads require read permission on the bucket. Can you please confirm..

https://discord.com/channels/564160730845151244/1216821517749321808/1217851387530973204

puntiz avatar Jun 07 '25 10:06 puntiz

Well I can confirm the issue is chunked uploads also require read writes in the bucket. I currently only have create rights on the bucket. I guess we can close the issue since it's more an Appwrite issue and not an SDK issue.

puntiz avatar Jun 10 '25 09:06 puntiz