sdk-for-flutter
sdk-for-flutter copied to clipboard
🐛 Bug Report: File upload fails if file is greater than 5 MB i.e., needs multiple chunks
👟 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
🎲 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?
- [x] I have read the Code of Conduct
@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 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.
Error
What is looks like on Appwrite console.
Hey @EVDOG4LIFE, were you able to reproduce this ?
@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
Waiting for upgrade path to 1.7.x to stabilise. Will upgrade and come back.
@puntiz 1.7.4 should be pretty stable now. try giving it a shot now?
@ChiragAgg5k upgraded today. Will test and come back in a day..
@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.
@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
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.