DHTMLX Docs & Samples Explorer

getData()

Returns the list of already uploaded files.

var myUploader = myForm.getUploader(name);
var data1 = myUploader.getData();
// or
var data2 = myForm.getItemValue(name); // recommended, used in dp and set/get form data

Return value:

  • object
data1 = {
  id0:{
     realName: "..",
     serverName: "..."
  },
  id1: {...},
  ...
}

data2 = {
  myFiles_count: 2,
  myFiles_r_0: "electric_guitar-m101.jpg",
  myFiles_r_1: "electric-guitar.jpg",
  myFiles_s_0: "electric_guitar-m101.jpg",
  myFiles_s_1: "electric-guitar.jpg"
}

for data1:

  • id0,id1,.. - the inner id generated by the form (used just inside the form)
  • realName - the real name of the file (as it's displayed in the control)
  • serverName - the file name that the server returns after uploading (the server can return any value you will specify in it)

for data2:

  • (item's name)+“_count” - the count of uploaded files (item name “myFiles” is used for the code above)
  • (item's name)+“_r_”+(0..count-1) - the real name of the file
  • (item's name)+“_s_”+(0..count-1) - the file name that the server returns after uploading