Can't read the document with a "File" type of file

Hi @jharmel.carmona ,

  1. You can declare the variable filename =path.GetFileName(file.ToString). This will return the filename instead of full file path.
  2. in for each loop you can get the file extensions by declaring a variable Path_extension= path.GetExtension(filename) , and then print out each file extension value, here you can check each file extension.
    3.After getting to know each file’s extension you can pass the same extension in your code.

Thanks & Regards,
Shubham Dutta