Field "IsFile" of FileManagerDirectoryContent is always false

When performing any action on a file using the Filemanager, the FileManagerDirectoryContent parameter for the FileOperations method seems to report the isFile field as false.
For example, select a single file and perform the rename operation. The args.isFile field is false.
Is that the correct behaviour? How should I know if the user selected a folder or a file to perform an operation for example?
Thank you.

3 Replies 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team March 3, 2021 01:30 PM UTC

Hi Luca,  
 
Greetings from Syncfusion support. 
 
We have checked your reported issue with FileManager component and unable to replicate the problem. isFile attribute is returned properly in both the OnMenuClick and FileSelected event. 
 
Please, refer the below screenshot. 
 
 
Please, refer the sample link. 
 
 
If the issue still persists, please share the below details to proceed further with your reported problem. 
 
  1. Which file provider used in your application?
  2. Share the steps to replicate the issue.
  3. If possible, please replicate the issue in attached sample.
  4. Share us the video footage of your reported problem.
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 




LU Luca March 4, 2021 07:47 AM UTC

Sorry, I should have been more specific: I'm talking about this method in the controller:   

[Route("FileOperations")]
public object FileOperations([FromBody] FileManagerDirectoryContent args)

In that method, when performing an operation on a single file, such as renaming it or deleting, the args.isFile field is always false. 
You can check this behaviour on your example by setting up a breakpoint in the method inside the HomeController file to check the isFile field value.


SP Sowmiya Padmanaban Syncfusion Team March 5, 2021 06:00 PM UTC

Hi Luca,  
  
We have checked your reported problem with FileManager component. In FileManager component, we have not send the isFile attribute from client to server side. By default, isFile is a Boolean variable, so it returns the default value as false. 
  
If you want to fetch the isFile details, we can pass the original data inside the args.Data for all the opeartions. 
  
Please, refer the screenshot. 
  
 
  
  
We suggest you to use args.Data for your requirement. 
  
Please let us know, if you need any further assistance. 
  
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon