How to get the exact file names?

Hello,

Directory.GetFiles(folder) or System.IO.Directory.GetFiles(folder) will give you the array of filepaths which you can loop through. So, that should be enough for your GetPDF activity cause the full filepath will tell it to use that file.

However, if you would like to only get the filename you can use Path.GetFilename(fullpath) or System.IO.Path.GetFilename(fullpath). So, in a ForEach file In Directory.GetFiles(folder) loop you could do Path.GetFilename(file) to get the filename only.

Like I said though, Directory.GetFiles(folder) should give you the fullpaths that you can use in read activities. Unless you need to change the folder location then use it with .GetFilename()

Regards.

C

21 Likes