Invalid URI: Invalid Port specified

I would like to use the File Manager on a local disk system.  However I keep getting this error: Invalid URI: Invalid Port specified

Why am I getting this and how can I get a list of files for a given folder?

TIA,

        <SfFileManager @ref="filemanager" TValue="FileManagerDirectoryContent">
            <FileManagerEvents TValue="FileManagerDirectoryContent" OnSend="onOnSend"></FileManagerEvents>
            <FileManagerAjaxSettings Url="\\RS818\main\documents\clients\"
                                     GetImageUrl="\\RS818\main\documents\clients\"
                                     UploadUrl="\\RS818\main\documents\clients\"
                                     DownloadUrl="\\RS818\main\documents\clients\">
            </FileManagerAjaxSettings>
        </SfFileManager>


5 Replies

IL Indhumathy Loganathan Syncfusion Team February 19, 2021 09:13 AM UTC

Hi Miles, 
 
Greetings from Syncfusion support. 
 
We have validated your reported query in FileManager. The mentioned error occurs due to the invalid path details in FileManagerAjaxSettings Url property. The Url property reads files from the server.  
 
You can include your directory files inside the wwwroot\\Files folder in the sample, then mention the location in the controller part. Please refer to the below code snippets. 
 
    [Route("api/[controller]")] 
    public class FileManagerController : Controller 
    { 
        public PhysicalFileProvider operation; 
        public string basePath; 
        string root = "wwwroot\\Files";  \\ Files denotes in which files and folders are available. 
        ………… 
        ………… 
 
By specifying Url as api/[controller name]/[operations], ajax request will be sent to the server, which then processes the request and sends back the response. 
 
<SfFileManager TValue="FileManagerDirectoryContent"> 
    <FileManagerAjaxSettings Url="/api/FileManager/FileOperations" 
                             GetImageUrl="/api/FileManager/GetImage" 
                             UploadUrl="/api/FileManager/Upload" 
                             DownloadUrl="/api/FileManager/Download"> 
    </FileManagerAjaxSettings> 
</SfFileManager> 
 
Please find the sample demonstrating the solution from the below link. 
 
 
Please refer the following links to know more about the Blazor FileManager component. 
 
 
 
 
Please, let us know if you need any further assistance. 
 
Regards, 
Indhumathy L


MG Miles Gibson February 19, 2021 05:44 PM UTC

Ok, thanks for the sample application.  Are you saying then that FileManager cannot deal with any files outside of www?  That creates a huge problem for my client, who has a separate document drive that they use for their legal documents etc.

How do I get around this limitation?  Or are you saying I can set the base path to whatever I want in the controller?

TIA,


IL Indhumathy Loganathan Syncfusion Team February 22, 2021 08:21 AM UTC

Hi Miles, 
 
We have validated your requirement in FileManager component. Yes, you can specify the base path based on your requirement in controller. You only need to specify the path of your directory files in the controller part. Please refer to the below code snippets. 
 
    [Route("api/[controller]")] 
    public class FileManagerController : Controller 
    { 
        public PhysicalFileProvider operation; 
        public string basePath = "D:\\Documents\\Files"; // Specify the path where files and folders are available. 
        public FileManagerController(IHostingEnvironment hostingEnvironment) 
        { 
            this.operation = new PhysicalFileProvider(); 
            this.operation.RootFolder(this.basePath); 
        } 
 
But the root folder path must be specified in the Server-side controller part and not in the client side. Please refer to the below sample. 
 
 
Please let us know if you need any further assistance. 
 
Regards, 
Indhumathy L 



MG Miles Gibson February 22, 2021 03:22 PM UTC

Ok, that will fine as long as I have a defined drive letter, is that right?  But how do I get it to work with a UNC path?  Will it work with a mapped drive, is that what you are saying I need to do?

This is what I want:

Ex:  \\RS818\main\documents\clients

where \\RS818 is a NAS containing document storage etc.

TIA,

Miles


IL Indhumathy Loganathan Syncfusion Team February 23, 2021 10:51 AM UTC

Hi Miles, 
 
Currently, we don’t have support for UNC file provider in FileManager component. Based on your request, we have considered it as a feature request. Support for this feature will be included in any one of our upcoming releases. Generally, we will plan any feature implementation based on customer request count, feature rank and wishlist plan for some feature.   
   
Please, track the following feedback link to know the status of this feature implementation.   
 
  
We appreciate your patience. 
 
Regards, 
Indhumathy L 


Loader.
Up arrow icon