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] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...