Skip to content
Back

[SOLVED] Appwrite Updating File Error

  • 0
  • Storage
  • Cloud
Drake
9 Sep, 2023, 04:46

Oh you're using Appwrite cloud?

TL;DR
Summary: The user was facing an error while updating a file with Appwrite. They were passing the wrong parameter name in the version 11.0.0 of Appwrite, causing the error. The solution was to use version 8.1.0. The user also noticed that the updated permission was not reflecting in the cloud or console, but the file was getting updated and create/update operations were working fine. The user was using the node SDK. It was suggested to remove a specific line of code and confirmed that setting self-signed was not necessary. It was also confirmed that the user was using Appwrite cloud. Solution: Use
ianmont
9 Sep, 2023, 04:46

yes

Drake
9 Sep, 2023, 04:47

Oh you don't need the set self signed then.

ianmont
9 Sep, 2023, 04:48

oh ok I'll remove that line of code

ianmont
9 Sep, 2023, 04:54

So the console log of the process.env.APPWRITE_ENDPOINT is "https://cloud.appwrite.io/v1"

The console log on the response of the newFilePermission inside getProductDocument function is: New Permission created { '$id': '64fbe41ede6fd6d2ecbb', bucketId: '64f9387bc57202784544', '$createdAt': '2023-09-09T03:18:55.369+00:00', '$updatedAt': '2023-09-09T04:50:44.468+00:00', '$permissions': [ 'read("user:64de92862ee341ef5a77")', 'update("user:64de92862ee341ef5a77")', 'delete("user:64de92862ee341ef5a77")' ], name: 'uwuuu.png', signature: '35d9be18d9c3d4510a126b62e2de85ef', mimeType: 'image/png', sizeOriginal: 1850419, chunksTotal: 1, chunksUploaded: 1 }

And it does change the $updatedAt variable.

Also the create documents and update does work, im currently testing it on my localhost, the only one that doesnt work is the one for updating the permissions of the file.

ianmont
9 Sep, 2023, 04:56

Also i console log the buyer and the ownerOfProduct, buyer="64fbde728881b69372bc", ownerOfProduct=" 64de92862ee341ef5a77"

ianmont
9 Sep, 2023, 04:57

Here on the appwrite cloud permissions of that file is still the same, theres only the creator permission that automatically creates with the file security, but still not the buyer permissions there

Drake
9 Sep, 2023, 05:54

Can you update it here?

Drake
9 Sep, 2023, 05:55

Did you make this change too?

ianmont
9 Sep, 2023, 05:57

yes

ianmont
9 Sep, 2023, 06:00

Do you mean if it lets me update from the cloud, like manually?

Drake
9 Sep, 2023, 15:32

Yes

ianmont
9 Sep, 2023, 16:07

yes it does let me update from the cloud manually

ianmont
9 Sep, 2023, 16:12

what could be happening?

Drake
9 Sep, 2023, 16:38

im baffled...it definitely is updating since updatedAt gets updated. and write operations work as create document and update document work.

you're using the node SDK, right? what version?

ianmont
9 Sep, 2023, 17:17

im using node-appwrite version 11.0.0

ianmont
9 Sep, 2023, 17:18

could it be that it is adding the permission to the user, but it does not show it in the cloud or in the console? or is that impossible?

Drake
9 Sep, 2023, 17:33

It should show

Drake
9 Sep, 2023, 17:34

Would you please use 8.1.0?

Drake
9 Sep, 2023, 17:35

Ya I'm pretty sure this is the problem

ianmont
10 Sep, 2023, 00:13

it works

ianmont
10 Sep, 2023, 00:14

thank you very much Steven, but why does it not work in version 11.0.0?

Drake
10 Sep, 2023, 01:05

11.0.0 is meant for Appwrite 1.4 where we added support for updating the file name. So, that parameter you were passing was name rather than permissions

ianmont
10 Sep, 2023, 05:26

oh i see, thanks

Drake
10 Sep, 2023, 06:29

[SOLVED] Appwrite Updating File Error

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more