I am trying to manage the user generated content such as images, videos etc in my appwrite storage so by every user registration i create a bucket for that user and from this point how can i manage the user data i mean in a normal scenario i would have different folders for each like images, videos etc how it works in appwrite sorage i can just have buckets and inside it all the file so i dont see the opportunity to do it folder wise so how can i manage all the stuffs per user.
Hi
You can try creating separate buckets during registration ( a suggestion) and have internal naming system defined by you for your own file structure - like adding prefixes for the files uploaded and/or adding a unique identifiable key to different users. You can use our https://appwrite.io/docs/client/storage?sdk=web-default#storageListFiles for listing
by adding a adding a unique identifiable key you mean while uploading the file i should also set some metadata to it and the search through a specific metadata?
In order to store files of a particular user you can create storage bucket for every user while your user registration using cloud functions and then you can manage that storage bucket for individual users files
First i need then to set the bucket id the user id? And second how would then the file name structure of all different user contents look like?
Yes you can set the user id of a user as their storage bucket id and add all files of that user to that particular storage bucket. And to get all of the files of a user use the ListFiles method
Hope this answers your question
yes thank you alot @Asutosh.
[SOLVED] Managing uploaded files per user in Appwrite Storage
Recommended threads
- [SOLVED] Appwrite Cloud and FRA cloud se...
Can anyone estimate how long this will take to resolve? I am checking status here https://status.appwrite.online/
- How to use Operator.arrayAppend on a rel...
Hi, is it possible to use any operator on a relationship column? I have a One to Many relationship column on a table and I would like to add entries to the colu...
- Large File Upload Issue with S3/RustFS
Hi, we are seeing a reproducible large upload failure with Appwrite 1.8.0 using S3-compatible storage through RustFS. A file upload of about 10.7 GB consistent...