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
close icon

Cannot read property 'code' of null in operation.js

i'm using file manager element like this

 
           
                                        downloadUrl="/AdminArea/Filemanager/Download"
                                        uploadUrl="/AdminArea/Filemanager/Upload"
                                        getImageUrl="/AdminArea/Filemanager/GetImage">
           

but when page loads i got this error in console "Cannot read property 'code' of null in operation.js ". and folders and files not loads
i get the result of "this.operation.GetFiles(args.Path, args.ShowHiddenItems)" in the controller and here is the result


   "cwd":
      "path":null,
      "action":null,
      "newName":null,
      "names":null,
      "name":"Files",
      "size":0,
      "previousName":null,
      "dateModified":"2019-10-06T07:07:29.0185244",
      "dateCreated":"2019-10-04T12:48:40.1017728",
      "hasChild":true,
      "isFile":false,
      "type":"",
      "id":null,
      "filterPath":"",
      "filterId":null,
      "targetPath":null,
      "renameFiles":null,
      "uploadFiles":null,
      "caseSensitive":false,
      "searchString":null,
      "showHiddenItems":false,
      "data":null,
      "targetData":null,
      "permission":null
   },
   "files":
      
         "path":null,
         "action":null,
         "newName":null,
         "names":null,
         "name":"test",
         "size":0,
         "previousName":null,
         "dateModified":"2019-10-06T07:07:29.0185244",
         "dateCreated":"2019-10-06T07:07:29.0185244",
         "hasChild":false,
         "isFile":false,
         "type":"",
         "id":null,
         "filterPath":"\\",
         "filterId":null,
         "targetPath":null,
         "renameFiles":null,
         "uploadFiles":null,
         "caseSensitive":false,
         "searchString":null,
         "showHiddenItems":false,
         "data":null,
         "targetData":null,
         "permission":null
      }
   ],
   "error":null,
   "details":null
}
any help would be grateful
Best regards

3 Replies

AB Ashokkumar Balasubramanian Syncfusion Team October 7, 2019 10:11 AM UTC

Hi sajad, 
 
Good day to you. 
 
We have checked your reported query that “cannot read code of null” error in all possible cases, the issue occurs only whenever the root path doesn’t contain any files or folders. We are suspect the same case also happened at your end. For your reference we have prepared and attached a video to exhibit the request sending to the server side. 
 
 
Also, we have prepared a file manager sample in .NET Core. Refer the sample link below. 
 
 
Can you please check with attached video and sample? If the issue persist, can you please share the below requested additional details will be more helpful to identify your reported issue at earlier. 
 
a.     Video for issue reproducing. 
b.     Code snippet for file manager operations in controller side. 
c.      Issue reproducing sample (if possible). 
 
Regards, 
Ashokkumar B. 



SA sajad October 7, 2019 02:59 PM UTC

hi Ashokkumar, tnx very much for replying,
your notes helped me to resolve the problem and actually the issue was not related to filemanager at all,
i am using asp boilerplate and it was wrapping the controller response with some extra data automatically, when i get rid of that wrapping, filemanager start working.
tnx again.


AB Ashokkumar Balasubramanian Syncfusion Team October 8, 2019 06:22 AM UTC

Hi sajad,  
 
We are glad to hear that the provided solution worked for you. Please let us know, if you need any further assistance. 
 
Regards, 
Ashokkumar B. 


Loader.
Live Chat Icon For mobile
Up arrow icon