function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KhalfeKhalfe 

Manage Files in folder and subfolder, like copy your files in your subolder choice

I need help, I'm trying to create a folder explorer in apex class and visualforce, it's when I want to copy a file in the folder, I can chose the folder or the sub-folder where I want to put my file in salesforce. 

I tri this code bellow, but I have an error  
enter public class selectFolder {
    public List<Account> md{get;set;}
    public selectFolder(ApexPages.StandardController Account) 
    {
        md = new List<Account>();
        md =  [Select Id,Name,(Select Id,name,(Select id, name from ContentFolderMember) 
        From Folder__c)From ContentFolderMember];
         List<Document> documents = [SELECT Id, FolderId, Folder.Name FROM Document 
        WHERE Folder.Name like 'ourLogo%' LIMIT 1];    
      } 
}
The error I have is this 
Select Id,Name,(Select Id,name,(Select id
          ^
ERROR at Row:1:Column:11
No such column 'Name' on entity 'ContentFolderMember'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
I did some research and I fine some topic talk about ContentDocuments, ContentFolder or ContentDocumentLinks, but I have no idea how it's work.
Thanks in advance.
SwethaSwetha (Salesforce Developers) 
HI Khalfe,
Can you check the inputs provided on https://salesforce.stackexchange.com/questions/313938/manage-files-in-folder-and-subfolder-like-copy-your-files-in-your-subolder-choi to see if it helps?

See ER diagram of Content Objects for reference https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_content.htm#sforce_api_erd_content

Thanks