UploadService().pickFile().then((file) async {
if (file != null) {
Logger().i(file.files.single.name);
// file info
String fileName = "${DateTime.now().toString()}-${file..names.first}";
Uuid uuid = const Uuid();
String fileId = uuid.v4();
var finFile = InputFile.fromPath(
path: file.files.single.path!,
filename: fileName,
);
try {
storage
.createFile(
bucketId: AppSettings.storageBucketId,
fileId: fileId,
file: finFile,
onProgress: (p0) {
Logger().d(p0);
},
)
.catchError((e) {
Logger().e(e);
});
} catch (e) {
Logger().e(e);
}
} else {
setState(() {
showUploadingScreen = false;
});
}
});
Using packages file_picker and uuid
interesting...can you check the file size with this?
final iofile = File(file.path!);
final size = await iofile.length();
print(size);
A file shown as 7.4 MiB in my file explorer prints 7735676. Appwrite docker container logs WARNING Port_onRead_http() (ERRNO 7102): Request Entity Too Large: header-length (1621) + content-length (40611618) is greater than the package_max_length(6291456) from session#3099 on 0.0.0.0:80
please add the code that i shared
I did, and it printed 7735676
oh sorry. i was confused because you said file explorer
My bad, I meant that in my file explorer the file shows up as 7.4 MiB and that it checks out comparing it to the value printed by the code you posted 😅
can you use the debugger and check if it's reaching here? https://github.com/appwrite/sdk-for-flutter/blob/44533ca07c20323705d97934cb2229c8b7960847/lib/src/client_io.dart#L296 Then check the value of that headers['content-range']
Will give it a try
The debugger's Network section says the content-length header for the file upload request is 40611618
I sent the same file as before by the way
this happens later.
im curious about this section
The exception is thrown at that line, so I cannot get the headers after the call
oh wait no it has content range
content range is bytes 0-5242879/7735676
So this is good...we should only be sending 5MB from the SDK...
Can you check the size of chunk?
Goes up to 5242879
Ya this seems all right ...can you test directly against Appwrite without nginx?
Will try
chunk and content-range is the same, appwrite SDK throws an appwrite exception with SIGPIPE and appwrite docker container logs the same error as before
sigpipe?? that's weird...
Recommended threads
- 1:1 relationship doesn’t sync after re-a...
Hi, I’m trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...
- Github connection error - Self Hosted Ap...
I am trying to connect my github account to deploy a project to sites, but Connect to Gtihub button is disabled. I have configured all Env variables needed for...