Access to attacment file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kertys
    Junior Member
    • Nov 2018
    • 8

    Access to attacment file

    Good day

    Please, help. There is entity "Test" with 2 field = "name" as Varchar and "testFile" as File. How I can access to realy file name (/data/upload). I use Dropdown action in detail view button with handler:

    ===
    actionTest: function (data, e) {
    Espo.Ajax
    .getRequest('Test/' + this.view.model.id)
    .then(response => {
    console.log(response);
    });

    nametest = this.view.model.get('name'); // Ok
    namefile= this.view.model.get('test_file_id'); //WRONG (undefined)

    ...
    },
    ===
    I need real file name

  • kertys
    Junior Member
    • Nov 2018
    • 8

    #2
    Sorry, it's simple...
    namefile= this.view.model.get('testFileName'); - get name of uploaded file
    realnamefile= this.view.model.get('testFileId'); - get real name of uploaded file in /data/upload

    Thanks/

    Comment

    Working...