
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
- Relationships restricted to a max depth ...
When I do query like: ``` await _databases.listDocuments( databaseId: AppwriteConfig.DATABASE_ID, collectionId: AppwriteConfig.SERVICES_COLLECTI...
- implement caching
It it possible to cache response for few minutes? I dont want to create function or implement a whole reverse server just to cache it in somewhere ?
- I am getting a 401 unauthorized response...
I have a Next.js application that stores user PDFs. I'm able to save them normally, but when trying to access the files using getFileView, I get a 401 Unauthori...
