ctm.getFile

The method of JS Bridge functionality is intended to obtain a local path to the file attachment of the Attachment or ContentVersion objects by using their ID.

Query format

ctm.getFile(Id)

Id is the ID of the Attachment record that should start from 00P or the ID of the ContentVersion record that should start with 068.

Handler

Use a handler function to describe the output format of the query results, e.g., to display the results of operations or method errors for debugging purposes.

ctm.getFile(“0681w000000GkoIAAS”)
ctm.getFile(Id, function(response){
console.log('Result', response);
})

The result:

{
    "response": "/private/var/mobile/Containers/Data/Application/6404F6A1-0A03-434A-A1C9-CB189141BC45/tmp/library1.png"
}
``