I was looking at the documentation and it seems that there's no way to authenticate file uploads? For example, if a user logs into my app I want to upload their file to storage using their session so that no random people can upload files.
This also allows me to track who uploaded what file and who has access to it.
Summary
Developers learnt how to authenticate file uploads and grant permissions effectively. File level permissions can be set to restrict access even with bucket permissions. The 'permissions' field indicates which users can access a file. For code implementation, permissions can be set in the bucket settings and during file creation. Documentation and resources provided for further assistance.
Kenny
Aug 26, 2024, 13:41
You can give bucket level permissions only allowing logged in users, or users with x label, or any number of items. You can also allow file level permissions giving only certain users access to a file.
Thank you! But how can this also be achieved in code? I'm very new to appwrite (but it's been AMAZING so far). I can't find it in the docs where to authenticate file uploads for apple
Kenny
Aug 26, 2024, 13:47
You set the permission in the console, in the bucket under settings. Then if you want file level permissions you can add them when creating the file.
Sorry, just quickly. If I set the attached permissions for the bucket, will they still only be allowed to access their own files if I also set up file level security? Or do the bucket permissions override file level security entirely?
Kenny
Aug 26, 2024, 13:57
When file security is enabled, users will be able to access files for which they have been granted either File or Bucket permissions.
If file security is disabled, users can access files only if they have Bucket permissions. File permissions will be ignored..
WhMonkey
Web Developer
Aug 26, 2024, 14:03
Yes but does that mean if they have bucket permissions to read, it overwrites the file permission not to read?
WhMonkey
Web Developer
Aug 26, 2024, 14:04
Like if User A uploads a document and all users have bucket permission to read, would User B be able to read User As document which has file permissions enabled?