How to structure the respond according to file manager

My server side respond for retrieve the file is giving respond

{

  "files": [],

  "data": {

    "path_prefix": "snowmanfro/customer/363/",

    "path": "snowmanfro/customer/363",

    "model": "Customer"

  },

  "message": "success",

  "code_status": 200

}



Cannot read properties of undefined (reading 'element')


Image_8761_1697447696216

and because of this on my console I could see error regarding, can I manipulate the respond to file manager structure what will be the structure ? 



1 Reply

SA SureshRajan Alagarsamy Syncfusion Team November 1, 2023 10:32 AM UTC

Ameer, In the File Manager component, we have handled file operations by fetching the response from the server. You can find the default response format for file operations at the following link. With this default response you can able to properly connect with our File Manager component.


Refer to the below user guide documentation for further details regarding the file operations request and response parameters.


Documentation : https://ej2.syncfusion.com/angular/documentation/file-manager/file-operations#file-operation-request-and-response-parameters


Additionally, we have listed the response parameters for some of the basic operations in the table below.


S.No

File Operation

Example Response Parameters

1

Read

{

  cwd:

  {

      name:"Download",

      size:0,

      dateModified:"2019-02-28T03:48:19.8319708+00:00",

      dateCreated:"2019-02-27T17:36:15.812193+00:00",

      hasChild:false,

      isFile:false,

      type:"",

      filterPath:\\Download\\

  },

  files:[

      {

          name:"Sample Work Sheet.xlsx",

          size:6172,

          dateModified:"2019-02-27T17:23:50.9651206+00:00",

          dateCreated:"2019-02-27T17:36:15.8151955+00:00",

          hasChild:false,

          isFile:true,

          type:".xlsx",

          filterPath:\\Download\\

      }

  ],

  error:null,

  details:null

}

2

Upload

The upload response is an empty string.

3

Download

Downloads the requested items from the file server in response.

4

GetImage

Return the image as a file stream in response.

5

Create

{

  cwd: null,

  files: [

      {

          dateCreated: "2019-03-15T10:25:05.3596171+00:00",

          dateModified: "2019-03-15T10:25:05.3596171+00:00",

          filterPath: null,

          hasChild: false,

          isFile: false,

          name: "New",

          size: 0,

          type: ""

      }

  ],

  details: null,

  error: null

}

6

Rename

{

  cwd:null,

  files:[

      {

          name:"seaview.jpg",

          size:95866,

          dateModified:"2019-03-20T08:45:56+00:00",

          dateCreated:"2019-03-20T05:22:34.6214847+00:00",

          hasChild:false,

          isFile:true,

          type:".jpg",

          filterPath:\\Pictures\\Nature\\seaview.jpg

      }

  ],

  error:null,

  details:null

}

 

7

Move

{

  cwd:null,

  files:[

      {

          path:null,

          action:null,

          newName:null,

          names:null,

          name:"justin biber.mp4",

          size:0,

          previousName:"justin biber.mp4",

          dateModified:"2019-06-21T06:58:32+00:00",

          dateCreated:"2019-06-24T04:26:49.2690476+00:00",

          hasChild:false,

          isFile:true,

          type:".mp4",

          id:null,

          filterPath:\\Videos\\

      }

  ],

  error:null,

  details:null

}

 

8

Copy

{

  cwd:null,

  files:[

      {

          path:null,

          action:null,

          newName:null,

          names:null,

          name:"justin.mp4",

          size:0,

          previousName:"album.mp4",

          dateModified:"2019-06-21T06:58:32+00:00",

          dateCreated:"2019-06-24T04:22:14.6245618+00:00",

          hasChild:false,

          isFile:true,

          type:".mp4",

          id:null,

          filterPath:"\\"

      }

  ],

  error:null,

  details:null

}

 

9

Delete

{

  cwd: null,

  details: null,

  error: null,

  files: [

      {

          dateCreated: "2019-03-15T10:13:30.346309+00:00",

          dateModified: "2019-03-15T10:13:30.346309+00:00",

          filterPath: "\Hello\folder",

          hasChild: true,

          isFile: false,

          name: "folder",

          size: 0,

          type: ""

      }

  ]

}

 

10

Details

{

  cwd:null,

  files:null,

  error:null,

  details:

  {

      name:"All Files",

      location:\\Files\\FileContents\\All Files,

      isFile:false,

      size:"679.8 KB",

      created:"3/8/2019 10:18:37 AM",

      modified:"3/8/2019 10:18:39 AM",

      multipleFiles:false

  }

}

 


Check out the shared details and get back to us if you need any further assistance.


Regards,
Suresh.



Loader.
Up arrow icon