Open the previous folder using OpenFileAsync()

Hi,

May I ask how to open the previous folder using the OpenFileAsync function in File Manager? I have tried using OpenFileAsync("..") and OpenFileAsync("/") but neither worked.

Thanks!


5 Replies

IL Indhumathy Loganathan Syncfusion Team July 15, 2021 01:30 PM UTC

Hi Denzel, 
 
Greetings from Syncfusion support. 
 
We have validated your requirement in File Manager component. We suspect that you want to use our OpenFileAsync method. The OpenFileAsync method opens the corresponding file or folder from the given unique identifier. The parameter of that method must be a file or folder name that has to be opened which must be available in the current path. 
 
Refer to the below code snippet. 
 
public void openfolder() 
{ 
    //Opens the Documents folder 
    this.filemanager.OpenFileAsync("Documents"); 
} 
 
For your reference, we have prepared a simple sample which will open the folder on a button click by using the OpenFileAsync method. You can find the sample from below link. 
 
 
Similar to the above code, you need to pass the folder name that you want to open as a parameter. Please let us know if you need any further assistance. 
 
Regards, 
Indhumathy L 



RS Roy Sunga July 15, 2021 01:48 PM UTC

Hi Indumathy,


Sorry but I do know how it works. What I'm asking for is how to open a previous folder using OpenFileAsync()?

Here's a scenario, I have the following folder structure "Documents/Sample" and I am currently in the Sample folder. I want to go back to the Documents folder on a button click. How can I achieve opening the Documents folder (which is the previous folder in this scn using the OpenFileAsync method? And if this is not possible, what are the ways that we can achieve that.


Thanks!



IL Indhumathy Loganathan Syncfusion Team July 16, 2021 05:31 PM UTC

Hi Denzel, 
 
We have validated your requirement in File Manager component. As mentioned in our previous update, the OpenFileAsync method opens the corresponding file or folder which is available in the current path. So we considered to achieve your requirement through customization. While preparing a sample, we have been facing an issue with Blazor File Manager OnFileOpen event. We have considered this as a bug and the fix for this issue will be included in our weekly patch releases by the month of August, 2021. You can track the status through the below portal link. 
 
 
Once the issue is resolved, we can use this event to fetch the previous folder path and update the Path property to move to the previous folder path in a external button click. 
 
We appreciate your patience. Please let us know if you need any further assistance. 
 
Regards, 
Indhumathy L


RS Roy Sunga July 20, 2021 08:41 PM UTC

Hi,


Can you confirm if clicking the breadcrumb links doesn't also trigger the OnFileOpen event? Would also like to add that on the fixes needed to be done as well.


Thanks!



KR Keerthana Rajendran Syncfusion Team July 21, 2021 08:05 AM UTC

Hi Denzel,  
 
Yes, navigating through the breadcrumb bar also doesn’t trigger the OnFileOpen event and we will consider this case too while fixing the reported issue. 
 
We will update the feedback status once it is completed and you can track this through the below link. 
 
 
Regards, 
Keerthana. 


Loader.
Up arrow icon