How do I determine the extention of a file attachment or a file embeded inside the PDF package?

Q: How to determine the extention of the file embeded inside the pdf
package file or as an attachment?
for ex if an excel file is present inside the package or attachment
file? or if incase how to to know that if the attachment file or
embeded file is a \"PDF\" file?

in case if the attachment pdf file name contains a \".\" something
like \"\"

sample code shown below

pdftron.SDF.NameTree myEmbeddedFiles = NameTree.Find(pDFDoc,
                if (myEmbeddedFiles.IsValid())
                    NameTreeIterator i =
                    NameTreeIterator myNameTreeIterator =
                    for (int myFileCounter = 0;
                        myNameTreeIterator.Next(), ++myFileCounter)
                        string myNameEntry =
FileSpec myFileSpec = new FileSpec(myNameTreeIterator.Value());
                        Filter myFileData = myFileSpec.GetFileData();
                        if (myFileData != null)
                            FilterReader reader = new
A: You are obtaining a file name in 'myNameEntry'. To obtain the
extension you could extract the extension after the last dot
character. Alternatively you could do the same with