how we can fetch the document extension name and document type in when we upload something on UI
Discussion posts and replies are publicly visible
Sounds like you should go to my old long-standing Feature Request and click "like" on it, and add a comment in support to amplify it and float it back to the top of Community for greater visibility. As far as I know, this is in Appian's "product enhancement backlog swamp" along with tons of other useful quality-of-life tweaks, to my chagrin.
I will let you in on the lesser-known fact, though, that the "get content object details by ID" function from the Content Details plug-in, CAN be fed a Doc ID and WILL return a text string containing the (full, un-parsed) filename, even for "newly uploaded but not yet submitted" documents. With a bit of work, this is a supported workaround that can help with your use case, though you must do it carefully and anyone who attempts this should first have a thorough understanding of how Expression Rules work in general.