You send the filename? Why you need it then later. Just use your stored value!?
Where did you "send" it?
Maybe i did not understand the problem. I´m not talking about the fact that in some cases the path is not available.
To check the content i would suggest to read the first bytes (dont know how much)... Maybe you can see the content in the first bytes. A zip for ex. does have a special header (also a lot of other files)...
A zip file for ex. starts with PK\x03\x04
A PDF with %PDF
Additionally:
You can search for all files by yourself (see for ex my wildcard-class). you can check the extention on all found files easyly
When i run my class over my external sdcard i get ALL files (not files from other apps) on my sdcard with the class.
Dont use my class with a path from content-chooser!
Use a real path on your device and scan this folder like you would do it with File.Listfiles
Using my class you need to build your own logic behind the files and folders you found (showing them, navigate through, select file/folder... But you are able to do