cancel
Showing results for 
Search instead for 
Did you mean: 

File type (Extension) using Unity API

Venkatroyal_Ayy
Champ in-the-making
Champ in-the-making

Hi,

 Is it possible to take the extension of a file (which is stored as document in OnBase) using Hyland.UnityDocument class?.

Let me know ASAP.

Venkat

4 REPLIES 4

Venkatroyal_Ayy
Champ in-the-making
Champ in-the-making

Hi All,

I was able to get the extension using the below property.

hylandDocument.DefaultFileType.Extension

Thanks 

Venkat

I don't think DefaultFileType.Extension will always have the correct value because an OnBase "document" could have multiple revisions/renditions (each with it's own physical document and extension) and there is only one default file type for a DocumentType.  To get the extension of a specific rendition, you would need to use retrieval (Application.Core.Retrieval) to get the PageData, which has an Extension property.

Timothy_Cosgrif
Star Collaborator
Star Collaborator

The DefaultFileType property will bring back the File Format that is configured on that Document's DocumentType.

The only other, albiet inefficient, way to get the file extension of the Document is to retrieve it through one of the DataProvider classes. The PageData class has an Extension property. The only limitation is that there may be some processing done to the Document that could possibly change the extension from the one stored on the disk group (i.e. a JPG file on disk retrieved through the ImageDataProvider will likely be converted to TIFF).

If you use the NativeDataProvider pageData.Extension gives you the file extension in the diskgroup.Good LuckScott