Check the solution provided here Wildcard file path . Replace xlsx with pdf & txt as per need.
Regards, Nithin