File Manager with custom Provider API

I want to create custom provider for File Manager, because I haven't really path on server, but it's API side on JSON response.


How can I implement this provider?


1 Reply

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team December 20, 2021 02:03 PM UTC

Hi Luca, 
   
Greetings from Syncfusion support.  
   
We have implemented the following file provider services for File Manager component.  
  
  
You can write your own custom provider for File Manager component by referring the above implemented service applications.  
  
The request and response data of File Manager for each action should be maintained with the following format.     
   
For example, read request will be in the following format:   
   
{      
    action: "read",      
    path: "/",      
    showHiddenItems: false,      
    data: []      
}      
      
And then returned response is in the below format.   
   
{    
    cwd:    
    {    
        name:"Download",    
        size:0,    
        dateModified:"2019-02-28T03:48:19.8319708+00:00",    
        dateCreated:"2019-02-27T17:36:15.812193+00:00",    
        hasChild:false,    
        isFile:false,    
        type:"",    
        filterPath:"\\Download\\"    
    },    
    files:[    
        {    
            name:"Sample Work Sheet.xlsx",    
            size:6172,    
            dateModified:"2019-02-27T17:23:50.9651206+00:00",    
            dateCreated:"2019-02-27T17:36:15.8151955+00:00",    
            hasChild:false,    
            isFile:true,    
            type:".xlsx",    
            filterPath:"\\Download\\"    
        }    
    ],    
    error:null,    
    details:null    
}    
   
Refer to the below link for all the File Manager operations and File Manager response.      
      
   
By default, File Manager only accepts the response from the in-built httpclient file operations of File Manager (Upload, Download, Read, Cut, Copy), as of now you can configure httpclient property with file operation method URLs (Defaults to { GetImageUrl: null; Url: null; UploadUrl: null; DownloadUrl: null;}).     
   
Refer the below response sent to the controller side.  
   
            
Returned response.     
   
             
 
 
Refer the below links to know more about the File Manager component.      
      
      
      
Please check the shared details, if you face any difficulties while implementing the custom provider revert with details to assist you promptly.Also, please confirm whether you are expecting to map JSON to FileManager component instead of mapping the file action paths to the FileManagerAjaxSettings property which will help us to serve you better.
   
Regards,  
Shameer Ali Baig S. 

Loader.
Up arrow icon