We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to get current path of filemanager without click on a file or folder?

Hi everyone,

How do I get the current path without clicking on anything. I want to be able to get the instance of a path wherever I am in the file manager. Example, I load the file manager and get the path or I go into a folder, don't click anything and am still able to get the path of that current folder I'm in. Is it possible, guys?


3 Replies 1 reply marked as answer

LD LeoLavanya Dhanaraj Syncfusion Team March 18, 2023 03:37 PM UTC

Hi Farai,


Greetings from Syncfusion support.


Based on your shared details, we understand that you need to find the current folder/file location of File Manager component in ASP.NET Core platform. You can get the current folder/file path details using the path property of FileManager component. For your reference, we have attached the sample. Here, we have printed current folder path in an external button click.


Check out the below mentioned code snippets for further assistance.


<button onclick="getPathDetails()">GetPath</button>

 

<ejs-filemanager id="filemanager">

    <e-filemanager-ajaxsettings url="/Home/FileOperations"

                                downloadUrl="/Home/Download"

                                uploadUrl="/Home/Upload"

                                getImageUrl="/Home/GetImage">

    </e-filemanager-ajaxsettings>

</ejs-filemanager>

 

<script>

    function getPathDetails(){

        var fileObj = document.getElementById("filemanager").ej2_instances[0];

        console.log(fileObj.path);

    }

</script>


Also, check out the below links to know more about Core FileaManager component.


Documentation : https://ej2.syncfusion.com/aspnetcore/documentation/file-manager/getting-started


API references : https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.FileManager.FileManager.html


Demo : https://ej2.syncfusion.com/aspnetcore/FileManager/Overview#/fluent


Please get back to us if you need any further assistance.


Regards,

Leo Lavanya Dhanaraj


Attachment: FileManager_199b6fb8.zip

Marked as answer

FA Farai March 23, 2023 11:52 AM UTC

Thanks a lot!



IL Indhumathy Loganathan Syncfusion Team March 24, 2023 05:55 AM UTC

Farai, Glad to hear that your reported query has been resolved. Please get back to us if you need any further assistance.


Loader.
Up arrow icon