04-07-2015 09:11 AM
Is there a method that will auto-discover a document's FileType? I'm looking for something that goes through the same process as if I using the Upload form in the Unity client or uses known extensions that match up to the default system file types.
04-07-2015 11:05 AM
Tharon,
The Unity Client actually reads the extension of the file that is being brought in to populate the FileType.
Here are 3 ways that you could get the FileType of the document being brought into OnBase:
1.) You can read in the string of the file that is being brought in, and parse out the extension from the file.
2.) You can create a PageData object from that file using the Storage class, and then utilize PageData.extension.
3.) You can use the DocumentType.DefaultFileType of whatever document type the document is being uploaded to.
Thanks,
Adam Ryman - Hyland API Analyst
04-07-2015 11:15 AM
Tharon,
To expand on that, you would have to have your own mapping between the file's extension and the FileType associated with that extension. The mapping that is used by the Unity Client to associate the proper FileType is not exposed to the Unity API.
There is an SCR (#167983) to add this functionality to the Unity API, which I will go ahead and add you too.
Please let me know if there is anything I can clarify.
Thanks,
Adam Ryman - Hyland API Analyst
04-07-2015 11:24 AM
OK. That's basically what I was looking for (a method like GetFileTypeFromExtension). I didn't want to make a custom configuration mapping if I didn't need to, but I will do that for now since it's not currently in the Unity API.
Thanks Adam!
07-06-2021 09:27 AM
Is there any news here? is SCR (#167983) been added to the Unity API?
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.