Skip to main content
July 31, 2024
Question

Knowlede Document getInternalFilename()

  • July 31, 2024
  • 3 replies
  • 0 views

I am updating a custom plugin that utilizes the Knowledge Document Type and uses the getInternalFilename() to get the absolute path of the document. That function has been deprecated, what is the preferred replacement, as I still need the absolute path of the document. Would getExternalFilename() return a similar value. 

3 replies

stefanhelzle0001
August 1, 2024

Find some alternatives here: https://docs.appian.com/suite/help/24.2/api/com/appiancorp/suiteapi/knowledge/Document.html#getInternalFilename()

You can also check other plugins from the app market for the included source code.

A word of caution here. My experience with developing plugins is quite limited.

Known Participant
September 8, 2024

Preferred way is to use the file stream APIs instead of the deprecated ones. Have listed a few use cases for working with documents.

For reading, use getInputStream of Document object returned by ContentService.download() api by passing the document id.

For updating an existing document, similarly use getOutputStream and write to the DocumentOutputStream returned.

For creating a new document, create a new Document object, call contentService.uploadDocument which returns a ContentUploadOutputStream. Then write data to this output stream. Note that the getContentId method returns the newly created document id.

kumara0180
September 8, 2024

Did you try documet(documentID,”URL”) ?