Console App Version of File System Provider

I was able to set up the file system provider from the github repo.  However, I was wondering if this functionality could be done with a vb.net console app instead.  If not, is there any way I can make my own that communicates with the file manager?  I know how to get the communication down between client and server, but I don't know how to talk to the file manager to give it the functionality such as reading and uploading files.

Thanks,
     William V.

3 Replies

SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team September 1, 2020 10:25 AM UTC

Hi William, 
 
Greetings from Syncfusion support. 
 
Query: if this functionality could be done with a vb.net console app instead. 
 
Currently, we have no service provider using console app with VB.net for FileManager. We have considered your requirement as a feature request in FileManager. The support for this feature will be included in any of our upcoming releases. 
 
Generally, we will plan to implement feature based on feature rank, wishlist plan and customer request count for some features. 
 
You can track the status of this feature implementation using the following feedback portal link. 
 
 
Query: I know how to get the communication down between client and server, but I don't know how to talk to the file manager to give it the functionality such as reading and uploading files. 
 
You can create your own API service for Syncfusion File Manager based on your requirement. The request data from FileManager and response data to File Manager argument to the controller methods 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 the below link for all the FileManager operations and FileManager response.  
  
  
By default, you cannot change the name of file action in ajax send request. 
  public object FileOperations([FromBody] FileManagerDirectoryContent args)  
        {  
            if (args.Action == "delete" || args.Action == "rename")  
            {  
                if ((args.TargetPath == null) && (args.Path == ""))  
                {  
                    FileManagerResponse response = new FileManagerResponse();  
                    response.Error = new ErrorDetails { Code = "401", Message = "Restricted to modify the root folder." };  
                    return this.operation.ToCamelCase(response);  
                }  
            }  
            switch (args.Action)  
            {  
                case "read": // This action name cannot be changed as.  
                   // reads the file(s) or folder(s) from the given path. You can create a own API inside the read opaertions.  
                    return this.operation.ToCamelCase(this.operation.GetFiles(args.Path, args.ShowHiddenItems));  
            }  
            return null;  
        }  
  
By default, FileManager only accepts the response from the in-built AJAX file operations of FileManager (Upload, Download, Read, Cut, Copy), as of now you can configure ajaxSettings property with file operation method URLs (Defaults to { getImageUrl: null; url: null; uploadUrl: null; downloadUrl: null;}). 
  
Refer the below link to know more about the available file provider services for FileManager component. 
  
  
If you want to send the Custom attribute to the controller side to perform file operation you can send such data in the beforeSend event and other events in the File Manager. Refer the following forum link in which we have sent additional parameter to the controller methods for file operations based on it.  
  
 
Refer the below link for the service available in the FileManager component.  
  
  
NodeJS service for FileManager component.  
  
  
  
ASP.NET Core service  
  
  
  
  
ASP.NET Core Azure cloud file system Provider  
  
  
SQL Database file system provider.  
  
  
  
Refer the below links to know more about the FileManager component.  
  
  
  
  
Please let us know, if you need any further assistance. 
 
Regards, 
Shameer Ali Baig S. 



WI William September 3, 2020 02:42 AM UTC

Thank you for your reply.  I have messages being sent the same way the file system provider does.  However, I'm stuck with how I can pass this string to the file manager.  For example, I sent a read command to the console server, and the server used operation.ToCamelCase(operation.GetFiles(args.Path, args.ShowHiddenItems)) to return a string back the client.  How would I give this string to the file manager to display the files.

Thanks,
     William V.


SP Sowmiya Padmanaban Syncfusion Team September 3, 2020 04:25 PM UTC

Hi William,  
 
By default, we have FileManagerDirectoryContent as a inbuilt class in FileManager component. Read and returned response will be in the below JSON format. 
 
Refer the below response sent to the controller side. 
 
 
 
Returned response. 
 
 
 
If your returned response contains all the argument specified in the FileManagerDirectoryContent (i.e.,Files) then FileManager component accepts the returned files/folder details and display the corresponding data in FileManager component. 
 
Refer the below code snippet for the argument present inside the FileManagerDirectoryContent. 
 
public class FileManagerDirectoryContent 
    { 
        public FileManagerDirectoryContent[] Data { get; set; } 
        public bool ShowHiddenItems { get; set; } 
        public string SearchString { get; set; } 
        public bool CaseSensitive { get; set; } 
        public IList<IFormFile> UploadFiles { get; set; } 
        public string[] RenameFiles { get; set; } 
        public string TargetPath { get; set; } 
        public string ParentId { get; set; } 
        public string FilterId { get; set; } 
        public string FilterPath { get; set; } 
        public string Id { get; set; } 
        public string Type { get; set; } 
        public bool IsFile { get; set; } 
        public bool HasChild { get; set; } 
        public DateTime DateCreated { get; set; } 
        public DateTime DateModified { get; set; } 
        public string PreviousName { get; set; } 
        public long Size { get; set; } 
        public string Name { get; set; } 
        public string[] Names { get; set; } 
        public string NewName { get; set; } 
        public string Action { get; set; } 
        public string Path { get; set; } 
        public FileManagerDirectoryContent TargetData { get; set; } 
        public AccessPermission Permission { get; set; } 
    } 
 
 
For your better understanding, refer the below local service for FileManager component. 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Loader.
Up arrow icon