
In digital ocean limits i found something in their docs
PUT
requests and individual parts of multi-part uploads sent to the Spaces CDN using pre-signed URLs have a maximum payload of 8,100 KiB, or 7.91 MiB.
Do you know that does appwrite use PUT
request while creating a file ?

these lines could not be deleted as well

appwrite | [Error] Method: DELETE
appwrite | [Error] URL: /v1/storage/buckets/:bucketId/files/:fileId
appwrite | [Error] Type: Exception
appwrite | [Error] Message:
appwrite | [Error] File: /usr/src/code/vendor/utopia-php/storage/src/Storage/Device/S3.php
appwrite | [Error] Line: 852
appwrite | [Error] Timestamp: 2023-10-16T22:43:15+00:00
appwrite | [Error] Method: DELETE
appwrite | [Error] URL: /v1/storage/buckets/:bucketId/files/:fileId
appwrite | [Error] Type: Exception
appwrite | [Error] Message:
appwrite | [Error] File: /usr/src/code/vendor/utopia-php/storage/src/Storage/Device/S3.php
appwrite | [Error] Line: 852
appwrite | [Error] Timestamp: 2023-10-16T22:43:16+00:00
appwrite | [Error] Method: DELETE
appwrite | [Error] URL: /v1/storage/buckets/:bucketId/files/:fileId
appwrite | [Error] Type: Exception
appwrite | [Error] Message:
appwrite | [Error] File: /usr/src/code/vendor/utopia-php/storage/src/Storage/Device/S3.php
appwrite | [Error] Line: 852
appwrite | [Error] Timestamp: 2023-10-16T22:46:21+00:00

everything is the same but different line catch error this time with the same message detail
appwrite | [Error] Method: POST
appwrite | [Error] URL: /v1/storage/buckets/:bucketId/files
appwrite | [Error] Type: Appwrite\Extend\Exception
appwrite | [Error] Message: The current user is not authorized to perform the requested action.
appwrite | [Error] File: /usr/src/code/app/controllers/api/storage.php
appwrite | [Error] Line: 664

This might be due to failed uploads. for uploads greater than 5MB, the needs to be chunked...and the user needs to be able to upload each chunk (so they must be authenticated)

Are you using an SDK for this?

Yes, appwrite/sdk-for-web 13.0.0

yea this is a chunk issue. should i do something before i upload ?
this is my uploadImage
function
async uploadImage(blob: any) {
let url = '';
try {
var file = new File([blob], this.cUserId, { type: blob.type });
// userService is a service with user related operations connected to appwrite-web-sdk
await this.userService.uploadFile(file).then(
(response) => {
console.log(response); // Success
url = this.userService.getFileView(response.$id).href;
console.log(url); // Resource URL
},
function (error) {
console.log(error); // Failure
}
);
return url;
} catch (e) {
throw e;
}
}

just as a reminder, only i got this issue when i try to upload greater then 5MB images.

From what I know, appwrite SDK chunks uploads automatically so not sure then

But at least from what I'm seeing, there is a common pattern in the screenshots you sent who is that all files with a size bigger than 6MB tend to fail

Yeah! this is only common pattern, otherwise it uploads without any doubt.

So, i could not solve this issue yet, before this ticket get auto-close label, do you have any suggestion ?

It never gets labeled automatically, we label it manually

thanks for this info

ππ»

Is the user authenticated? Does the request include the fallback header or session cookie?

yes user authenticated, thats why first chunk has been written in appwrite successfully, i am using the same api call, less than 5M is ok, it uploads well as shown in the screenshot.
However greater than 5M is returning code 401. i am calling the same function, less then 5M uploads fine without any error. Greater then 5M returns 401.
Still get confused why it happens?

What are the permissions on the bucket? What permissions are you putting when creating the file?

this is permissions of bucket, im not setting any spesific permission while creating a file.

File Security disabled. These files are public info of users like profile picture so everyone can read but only users can create

Should i override to give role of Users
to READ
permission?

I think if the role of Any
can read, then everyone can read!

if file security is disabled, the permissions you add on the file won't do anything

i think you may need to add update permissions...but feel free to create an issue to see if Appwrite can be updated to only require create access
Recommended threads
- Is it possible to cancel an ongoing file...
When uploading a file to storage, is there a way to cancel the upload in progress so the file is not saved or partially stored?
- File level security overrides File Token...
are file tokens not supposed to work with file level security? so if i make it such that only the user who uploads the file has read access and i then create a ...
- Can't start docker containers beacuse no...
Hi, I'm testing my app where I upload also files to appwrite storage. As I suspect, I've filled up my disk. Now I can't start Appwrite. Could I ask for help wit...
